[PATCH] D34214: Hide dbgs() stream for when built with -fmodules.
Frederich Munch via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 14 11:34:02 PDT 2017
marsupial updated this revision to Diff 102582.
marsupial edited the summary of this revision.
marsupial added a comment.
This should be more 'obviously' correct.
Sorry, some CMake confusion here....
https://reviews.llvm.org/D34214
Files:
include/llvm/Support/DebugCounter.h
include/llvm/Transforms/Scalar/GVNExpression.h
lib/Support/DebugCounter.cpp
lib/Transforms/Scalar/GVNSink.cpp
Index: lib/Transforms/Scalar/GVNSink.cpp
===================================================================
--- lib/Transforms/Scalar/GVNSink.cpp
+++ lib/Transforms/Scalar/GVNSink.cpp
@@ -285,6 +285,11 @@
typedef DenseSet<ModelledPHI, DenseMapInfo<ModelledPHI>> ModelledPHISet;
+LLVM_DUMP_METHOD llvm::GVNExpression::dump() const {
+ print(dbgs());
+ dbgs() << "\n";
+}
+
//===----------------------------------------------------------------------===//
// ValueTable
//===----------------------------------------------------------------------===//
Index: lib/Support/DebugCounter.cpp
===================================================================
--- lib/Support/DebugCounter.cpp
+++ lib/Support/DebugCounter.cpp
@@ -102,9 +102,13 @@
}
}
-void DebugCounter::print(raw_ostream &OS) {
+void DebugCounter::print(raw_ostream &OS) const {
OS << "Counters and values:\n";
for (const auto &KV : Counters)
OS << left_justify(RegisteredCounters[KV.first], 32) << ": {"
<< KV.second.first << "," << KV.second.second << "}\n";
}
+
+LLVM_DUMP_METHOD void DebugCounter::dump() const {
+ print(dbgs());
+}
Index: include/llvm/Transforms/Scalar/GVNExpression.h
===================================================================
--- include/llvm/Transforms/Scalar/GVNExpression.h
+++ include/llvm/Transforms/Scalar/GVNExpression.h
@@ -121,10 +121,7 @@
OS << "}";
}
- LLVM_DUMP_METHOD void dump() const {
- print(dbgs());
- dbgs() << "\n";
- }
+ LLVM_DUMP_METHOD void dump() const;
};
inline raw_ostream &operator<<(raw_ostream &OS, const Expression &E) {
Index: include/llvm/Support/DebugCounter.h
===================================================================
--- include/llvm/Support/DebugCounter.h
+++ include/llvm/Support/DebugCounter.h
@@ -121,10 +121,10 @@
Us.Counters[ID] = Val;
}
- // Dump or print the current counter set.
- LLVM_DUMP_METHOD void dump() { print(dbgs()); }
+ // Dump or print the current counter set into llvm::dbgs().
+ LLVM_DUMP_METHOD void dump() const;
- void print(raw_ostream &OS);
+ void print(raw_ostream &OS) const;
// Get the counter ID for a given named counter, or return 0 if none is found.
unsigned getCounterId(const std::string &Name) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34214.102582.patch
Type: text/x-patch
Size: 2294 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170614/764f5f1d/attachment.bin>
More information about the llvm-commits
mailing list