[llvm] 93de5f1 - [CodeGen] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 20:08:41 PST 2023


Author: Kazu Hirata
Date: 2023-02-16T20:08:35-08:00
New Revision: 93de5f13b9ddda64951d6674f92e00510ce4f8c0

URL: https://github.com/llvm/llvm-project/commit/93de5f13b9ddda64951d6674f92e00510ce4f8c0
DIFF: https://github.com/llvm/llvm-project/commit/93de5f13b9ddda64951d6674f92e00510ce4f8c0.diff

LOG: [CodeGen] Fix warnings

This patch fixes:

  llvm/lib/CodeGen/CallBrPrepare.cpp:154:14: error: unused variable
  'IsDominated' [-Werror,-Wunused-variable]

  llvm/lib/CodeGen/CallBrPrepare.cpp:150:13: error: unused function
  'PrintDebugDomInfo' [-Werror,-Wunused-function]

Added: 
    

Modified: 
    llvm/lib/CodeGen/CallBrPrepare.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CallBrPrepare.cpp b/llvm/lib/CodeGen/CallBrPrepare.cpp
index 56c2db9392b7..db243a0bfebe 100644
--- a/llvm/lib/CodeGen/CallBrPrepare.cpp
+++ b/llvm/lib/CodeGen/CallBrPrepare.cpp
@@ -147,17 +147,18 @@ static bool IsInSameBasicBlock(const Use &U, const BasicBlock *BB) {
   return I && I->getParent() == BB;
 }
 
+#ifndef NDEBUG
 static void PrintDebugDomInfo(const DominatorTree &DT, const Use &U,
                               const BasicBlock *BB, bool IsDefaultDest) {
   if (!isa<Instruction>(U.getUser()))
     return;
-  const bool IsDominated = DT.dominates(BB, U);
   LLVM_DEBUG(dbgs() << "Use: " << *U.getUser() << ", in block "
                     << cast<Instruction>(U.getUser())->getParent()->getName()
-                    << ", is " << (IsDominated ? "" : "NOT ") << "dominated by "
-                    << BB->getName() << " (" << (IsDefaultDest ? "in" : "")
-                    << "direct)\n");
+                    << ", is " << (DT.dominates(BB, U) ? "" : "NOT ")
+                    << "dominated by " << BB->getName() << " ("
+                    << (IsDefaultDest ? "in" : "") << "direct)\n");
 }
+#endif
 
 void CallBrPrepare::UpdateSSA(DominatorTree &DT, CallBrInst *CBR,
                               CallInst *Intrinsic,


        


More information about the llvm-commits mailing list