llvm.org GIT mirror llvm / 0caff99
-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 David Blaikie 5 years ago
2 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1919 using namespace llvm;
2020
2121 LogBuilder::~LogBuilder() {
22 consumer.logf(*this);
22 if (consumer)
23 consumer->logf(*this);
2324 }
2425
2526 StringRef LogBuilder::getFormat() const { return Format; }
2626
2727 /// A temporary-object class for building up log messages.
2828 class LogBuilder {
29 Consumer &consumer;
29 Consumer *consumer;
3030
3131 /// The use of a stored StringRef here is okay because
3232 /// LogBuilder should be used only as a temporary, and as a
3737 SmallVector Arguments;
3838
3939 public:
40 LogBuilder(Consumer &c, StringRef Format)
41 : consumer(c), Format(Format) {}
40 LogBuilder(Consumer &c, StringRef Format) : consumer(&c), Format(Format) {}
41 LogBuilder(LogBuilder &&L)
42 : consumer(L.consumer), Format(L.Format),
43 Arguments(std::move(L.Arguments)) {
44 L.consumer = nullptr;
45 }
4246
4347 LogBuilder &operator<<(Value *V) {
4448 Arguments.push_back(V);