mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-20 11:23:29 +00:00
-Wdeprecated clean by making LogBuilder move constructible so it can be returned by value (in DifferenceEngine::logf)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244129 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8cfa23f93a
commit
0caff999ff
@ -20,7 +20,8 @@
|
||||
using namespace llvm;
|
||||
|
||||
LogBuilder::~LogBuilder() {
|
||||
consumer.logf(*this);
|
||||
if (consumer)
|
||||
consumer->logf(*this);
|
||||
}
|
||||
|
||||
StringRef LogBuilder::getFormat() const { return Format; }
|
||||
|
@ -27,7 +27,7 @@ namespace llvm {
|
||||
|
||||
/// A temporary-object class for building up log messages.
|
||||
class LogBuilder {
|
||||
Consumer &consumer;
|
||||
Consumer *consumer;
|
||||
|
||||
/// The use of a stored StringRef here is okay because
|
||||
/// LogBuilder should be used only as a temporary, and as a
|
||||
@ -38,8 +38,12 @@ namespace llvm {
|
||||
SmallVector<Value*, 4> Arguments;
|
||||
|
||||
public:
|
||||
LogBuilder(Consumer &c, StringRef Format)
|
||||
: consumer(c), Format(Format) {}
|
||||
LogBuilder(Consumer &c, StringRef Format) : consumer(&c), Format(Format) {}
|
||||
LogBuilder(LogBuilder &&L)
|
||||
: consumer(L.consumer), Format(L.Format),
|
||||
Arguments(std::move(L.Arguments)) {
|
||||
L.consumer = nullptr;
|
||||
}
|
||||
|
||||
LogBuilder &operator<<(Value *V) {
|
||||
Arguments.push_back(V);
|
||||
|
Loading…
x
Reference in New Issue
Block a user