Skip to content

Commit

Permalink
[CodeGen] Fix warnings
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
kazutakahirata committed Feb 17, 2023
1 parent 0eabb88 commit 93de5f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llvm/lib/CodeGen/CallBrPrepare.cpp
Expand Up @@ -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,
Expand Down

0 comments on commit 93de5f1

Please sign in to comment.