[analyzer] Fix -Wunused-function in NDEBUG builds with #ifdef LLVM_DUMP_METHOD
authorFangrui Song <maskray@google.com>
Mon, 22 Jul 2019 04:14:09 +0000 (04:14 +0000)
committerFangrui Song <maskray@google.com>
Mon, 22 Jul 2019 04:14:09 +0000 (04:14 +0000)
llvm-svn: 366663

clang/lib/StaticAnalyzer/Core/RegionStore.cpp

index d2aea1f..3459220 100644 (file)
@@ -108,7 +108,7 @@ public:
            Data == X.Data;
   }
 
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 };
 } // end anonymous namespace
 
@@ -135,7 +135,9 @@ static inline raw_ostream &operator<<(raw_ostream &Out, BindingKey K) {
 
 } // namespace llvm
 
-LLVM_DUMP_METHOD void BindingKey::dump() const { llvm::errs() << *this; }
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+void BindingKey::dump() const { llvm::errs() << *this; }
+#endif
 
 //===----------------------------------------------------------------------===//
 // Actual Store type.