llvm.org GIT mirror llvm / e49b209
Hide dbgs() stream for when built with -fmodules. Summary: Make DebugCounter::print and dump methods to be const correct. Reviewers: aprantl Reviewed By: aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34214 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305408 91177308-0d34-0410-b5e6-96231b3b80d8 Frederich Munch 2 years ago
4 changed file(s) with 20 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
120120 Us.Counters[ID] = Val;
121121 }
122122
123 // Dump or print the current counter set.
124 LLVM_DUMP_METHOD void dump() { print(dbgs()); }
123 // Dump or print the current counter set into llvm::dbgs().
124 LLVM_DUMP_METHOD void dump() const;
125125
126 void print(raw_ostream &OS);
126 void print(raw_ostream &OS) const;
127127
128128 // Get the counter ID for a given named counter, or return 0 if none is found.
129129 unsigned getCounterId(const std::string &Name) const {
120120 OS << "}";
121121 }
122122
123 LLVM_DUMP_METHOD void dump() const {
124 print(dbgs());
125 dbgs() << "\n";
126 }
123 LLVM_DUMP_METHOD void dump() const;
127124 };
128125
129126 inline raw_ostream &operator<<(raw_ostream &OS, const Expression &E) {
101101 }
102102 }
103103
104 void DebugCounter::print(raw_ostream &OS) {
104 void DebugCounter::print(raw_ostream &OS) const {
105105 OS << "Counters and values:\n";
106106 for (const auto &KV : Counters)
107107 OS << left_justify(RegisteredCounters[KV.first], 32) << ": {"
108108 << KV.second.first << "," << KV.second.second << "}\n";
109109 }
110
111 LLVM_DUMP_METHOD void DebugCounter::dump() const {
112 print(dbgs());
113 }
6262 #define DEBUG_TYPE "gvn-sink"
6363
6464 STATISTIC(NumRemoved, "Number of instructions removed");
65
66 namespace llvm {
67 namespace GVNExpression {
68
69 LLVM_DUMP_METHOD void Expression::dump() const {
70 print(dbgs());
71 dbgs() << "\n";
72 }
73
74 }
75 }
6576
6677 namespace {
6778