From 5b0bcb21c969c8426c5dcfe484b5d6ed78779f2a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 20 Aug 2019 04:14:43 +0000 Subject: [PATCH] MCAsmMacro: add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to some dump() declarations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369324 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCAsmMacro.h | 11 ++++++----- lib/MC/MCAsmMacro.cpp | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/llvm/MC/MCAsmMacro.h b/include/llvm/MC/MCAsmMacro.h index 364d3b5f366..7eecce0faf6 100644 --- a/include/llvm/MC/MCAsmMacro.h +++ b/include/llvm/MC/MCAsmMacro.h @@ -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 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 diff --git a/lib/MC/MCAsmMacro.cpp b/lib/MC/MCAsmMacro.cpp index ba4fb7d4f38..186a68b02a2 100644 --- a/lib/MC/MCAsmMacro.cpp +++ b/lib/MC/MCAsmMacro.cpp @@ -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) const { } OS << " (BEGIN BODY)" << Body << "(END BODY)\n"; } +#endif -- 2.40.0