[llvm] r369324 - MCAsmMacro: add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to some dump() declarations
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 21:14:43 PDT 2019
Author: maskray
Date: Mon Aug 19 21:14:43 2019
New Revision: 369324
URL: http://llvm.org/viewvc/llvm-project?rev=369324&view=rev
Log:
MCAsmMacro: add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to some dump() declarations
Modified:
llvm/trunk/include/llvm/MC/MCAsmMacro.h
llvm/trunk/lib/MC/MCAsmMacro.cpp
Modified: llvm/trunk/include/llvm/MC/MCAsmMacro.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmMacro.h?rev=369324&r1=369323&r2=369324&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAsmMacro.h (original)
+++ llvm/trunk/include/llvm/MC/MCAsmMacro.h Mon Aug 19 21:14:43 2019
@@ -124,7 +124,6 @@ public:
}
void dump(raw_ostream &OS) const;
- void dump() const { dump(dbgs()); }
};
struct MCAsmMacroParameter {
@@ -133,10 +132,10 @@ struct MCAsmMacroParameter {
bool Required = false;
bool Vararg = false;
- MCAsmMacroParameter() = default;
-
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const { dump(dbgs()); }
- void dump(raw_ostream &OS) const;
+ LLVM_DUMP_METHOD void dump(raw_ostream &OS) const;
+#endif
};
typedef std::vector<MCAsmMacroParameter> MCAsmMacroParameters;
@@ -149,8 +148,10 @@ public:
MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P)
: Name(N), Body(B), Parameters(std::move(P)) {}
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const { dump(dbgs()); }
- void dump(raw_ostream &OS) const;
+ LLVM_DUMP_METHOD void dump(raw_ostream &OS) const;
+#endif
};
} // namespace llvm
Modified: llvm/trunk/lib/MC/MCAsmMacro.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmMacro.cpp?rev=369324&r1=369323&r2=369324&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmMacro.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmMacro.cpp Mon Aug 19 21:14:43 2019
@@ -11,6 +11,7 @@
using namespace llvm;
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void MCAsmMacroParameter::dump(raw_ostream &OS) const {
OS << "\"" << Name << "\"";
if (Required)
@@ -39,3 +40,4 @@ void MCAsmMacro::dump(raw_ostream &OS) c
}
OS << " (BEGIN BODY)" << Body << "(END BODY)\n";
}
+#endif
More information about the llvm-commits
mailing list