[llvm] 2ac0624 - [LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress -Wunused-function

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 17:25:45 PDT 2020


Author: Fangrui Song
Date: 2020-09-18T17:25:37-07:00
New Revision: 2ac06241d277c969c0dee0f40fb4f00971a4d7f7

URL: https://github.com/llvm/llvm-project/commit/2ac06241d277c969c0dee0f40fb4f00971a4d7f7
DIFF: https://github.com/llvm/llvm-project/commit/2ac06241d277c969c0dee0f40fb4f00971a4d7f7.diff

LOG: [LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress -Wunused-function

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index e39811e33e8c..5c05fbd62949 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -2905,6 +2905,7 @@ void InstrRefBasedLDV::vlocDataflow(
   BlocksToExplore.clear();
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void InstrRefBasedLDV::dump_mloc_transfer(
     const MLocTransferMap &mloc_transfer) const {
   for (auto &P : mloc_transfer) {
@@ -2913,6 +2914,7 @@ void InstrRefBasedLDV::dump_mloc_transfer(
     dbgs() << "Loc " << foo << " --> " << bar << "\n";
   }
 }
+#endif
 
 void InstrRefBasedLDV::emitLocations(
     MachineFunction &MF, LiveInsT SavedLiveIns, ValueIDNum **MInLocs,


        


More information about the llvm-commits mailing list