[clang-tools-extra] 632e15e - Conditionalize function only used in an assert to address -Wunused-function

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 29 16:40:10 PDT 2021


Author: David Blaikie
Date: 2021-06-29T16:39:59-07:00
New Revision: 632e15e766ee625ae367b2e872f3df903e507bfb

URL: https://github.com/llvm/llvm-project/commit/632e15e766ee625ae367b2e872f3df903e507bfb
DIFF: https://github.com/llvm/llvm-project/commit/632e15e766ee625ae367b2e872f3df903e507bfb.diff

LOG: Conditionalize function only used in an assert to address -Wunused-function

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
index 72f5b25e9f66a..8e972298adcec 100644
--- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
@@ -167,10 +167,6 @@ static inline std::string formatMixFlags(MixFlags F) {
   return Str.str().str();
 }
 
-#else
-
-static inline std::string formatMixFlags(MixFlags F);
-
 #endif // NDEBUG
 
 /// The results of the steps of an Implicit Conversion Sequence is saved in

diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 75e551b665185..c29900b2c694d 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -3606,15 +3606,19 @@ LDVSSABlock *LDVSSABlockIterator::operator*() {
   return Updater.getSSALDVBlock(*PredIt);
 }
 
-} // namespace
-
-namespace llvm {
+#ifndef NDEBUG
 
 raw_ostream &operator<<(raw_ostream &out, const LDVSSAPhi &PHI) {
   out << "SSALDVPHI " << PHI.PHIValNum;
   return out;
 }
 
+#endif
+
+} // namespace
+
+namespace llvm {
+
 /// Template specialization to give SSAUpdater access to CFG and value
 /// information. SSAUpdater calls methods in these traits, passing in the
 /// LDVSSAUpdater object, to learn about blocks and the values they define.


        


More information about the cfe-commits mailing list