[llvm] r309572 - Extend ifdefs to more unused helper functions.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 09:11:43 PDT 2017


Author: fhahn
Date: Mon Jul 31 09:11:43 2017
New Revision: 309572

URL: http://llvm.org/viewvc/llvm-project?rev=309572&view=rev
Log:
Extend ifdefs to more unused helper functions.

This fixes a buildbot failure with -Werror introduced by r309553


Modified:
    llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Modified: llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp?rev=309572&r1=309571&r2=309572&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp Mon Jul 31 09:11:43 2017
@@ -350,6 +350,7 @@ static void printDebugLoc(const DebugLoc
   CommentOS << " ]";
 }
 
+#ifndef NDEBUG
 static void printExtendedName(raw_ostream &OS, const DILocalVariable *V,
                               const DILocation *DL) {
   const LLVMContext &Ctx = V->getContext();
@@ -365,7 +366,6 @@ static void printExtendedName(raw_ostrea
   }
 }
 
-#ifndef NDEBUG
 void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
   auto *DV = cast<DILocalVariable>(Variable);
   OS << "!\"";

Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=309572&r1=309571&r2=309572&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Jul 31 09:11:43 2017
@@ -562,6 +562,7 @@ bool Formula::hasRegsUsedByUsesOtherThan
   return false;
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void Formula::print(raw_ostream &OS) const {
   bool First = true;
   if (BaseGV) {
@@ -598,7 +599,6 @@ void Formula::print(raw_ostream &OS) con
   }
 }
 
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 LLVM_DUMP_METHOD void Formula::dump() const {
   print(errs()); errs() << '\n';
 }
@@ -1394,6 +1394,7 @@ bool LSRFixup::isUseFullyOutsideLoop(con
   return !L->contains(UserInst);
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void LSRFixup::print(raw_ostream &OS) const {
   OS << "UserInst=";
   // Store is common and interesting enough to be worth special-casing.
@@ -1417,7 +1418,6 @@ void LSRFixup::print(raw_ostream &OS) co
     OS << ", Offset=" << Offset;
 }
 
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 LLVM_DUMP_METHOD void LSRFixup::dump() const {
   print(errs()); errs() << '\n';
 }
@@ -1500,6 +1500,7 @@ void LSRUse::RecomputeRegs(size_t LUIdx,
       RegUses.dropRegister(S, LUIdx);
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void LSRUse::print(raw_ostream &OS) const {
   OS << "LSR Use: Kind=";
   switch (Kind) {
@@ -1533,7 +1534,6 @@ void LSRUse::print(raw_ostream &OS) cons
     OS << ", widest fixup type: " << *WidestFixupType;
 }
 
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 LLVM_DUMP_METHOD void LSRUse::dump() const {
   print(errs()); errs() << '\n';
 }
@@ -5320,6 +5320,7 @@ LSRInstance::LSRInstance(Loop *L, IVUser
   ImplementSolution(Solution);
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void LSRInstance::print_factors_and_types(raw_ostream &OS) const {
   if (Factors.empty() && Types.empty()) return;
 
@@ -5364,7 +5365,6 @@ void LSRInstance::print_uses(raw_ostream
   }
 }
 
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void LSRInstance::print(raw_ostream &OS) const {
   print_factors_and_types(OS);
   print_fixups(OS);




More information about the llvm-commits mailing list