]> granicus.if.org Git - clang/commitdiff
Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.
authorEric Christopher <echristo@gmail.com>
Thu, 16 Nov 2017 03:18:09 +0000 (03:18 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 16 Nov 2017 03:18:09 +0000 (03:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318371 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp

index 848c2662019a151a362caa6d7a920e941075fd85..b944f90539d42c9ac0095b0c38223a4d76f248fa 100644 (file)
@@ -259,6 +259,7 @@ void ArrayBoundCheckerV2::reportOOB(CheckerContext &checkerContext,
       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::dump() const {
 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,
index 693a617fb6775605899820fffa44909e0ef24307..39b92ee3a18dcc602a994798f82fb07398bf89f2 100644 (file)
@@ -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.