r318371 - Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 19:18:09 PST 2017


Author: echristo
Date: Wed Nov 15 19:18:09 2017
New Revision: 318371

URL: http://llvm.org/viewvc/llvm-project?rev=318371&view=rev
Log:
Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp?rev=318371&r1=318370&r2=318371&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp Wed Nov 15 19:18:09 2017
@@ -259,6 +259,7 @@ void ArrayBoundCheckerV2::reportOOB(Chec
       llvm::make_unique<BugReport>(*BT, os.str(), errorNode));
 }
 
+#ifndef NDEBUG
 LLVM_DUMP_METHOD void RegionRawOffsetV2::dump() const {
   dumpToStream(llvm::errs());
 }
@@ -266,7 +267,7 @@ LLVM_DUMP_METHOD void RegionRawOffsetV2:
 void RegionRawOffsetV2::dumpToStream(raw_ostream &os) const {
   os << "raw_offset_v2{" << getRegion() << ',' << getByteOffset() << '}';
 }
-
+#endif
 
 // Lazily computes a value to be used by 'computeOffset'.  If 'val'
 // is unknown or undefined, we lazily substitute '0'.  Otherwise,

Modified: cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=318371&r1=318370&r2=318371&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp Wed Nov 15 19:18:09 2017
@@ -134,7 +134,9 @@ namespace llvm {
   };
 } // end llvm namespace
 
+#ifndef NDEBUG
 LLVM_DUMP_METHOD void BindingKey::dump() const { llvm::errs() << *this; }
+#endif
 
 //===----------------------------------------------------------------------===//
 // Actual Store type.




More information about the cfe-commits mailing list