diff options
author | Devang Patel <dpatel@apple.com> | 2008-11-19 19:01:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-11-19 19:01:37 +0000 |
commit | 79303b25722dabff43f68f750d84edb5335ca76f (patch) | |
tree | 470dd6739017209f257f154ec441f9053c152ead /llvm/lib | |
parent | 827bced2b17c4dc04c756130bcef26dce7a95628 (diff) | |
download | bcm5719-llvm-79303b25722dabff43f68f750d84edb5335ca76f.tar.gz bcm5719-llvm-79303b25722dabff43f68f750d84edb5335ca76f.zip |
Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
llvm-svn: 59659
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Utils/DbgInfoUtils.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/llvm/lib/Transforms/Utils/DbgInfoUtils.cpp b/llvm/lib/Transforms/Utils/DbgInfoUtils.cpp deleted file mode 100644 index 4bd116a6e56..00000000000 --- a/llvm/lib/Transforms/Utils/DbgInfoUtils.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//===-- DbgInfoUtils.cpp - DbgInfo Utilities -------------------------------==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Utility functions to manipulate debugging information. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Transforms/Utils/DbgInfoUtils.h" -#include "llvm/IntrinsicInst.h" - -using namespace llvm; - -/// RemoveDeadDbgIntrinsics - Remove dead dbg intrinsics from this -/// basic block. -void llvm::RemoveDeadDbgIntrinsics(BasicBlock &BB) { - BasicBlock::iterator BI = BB.begin(), BE = BB.end(); - if (BI == BE) return; - - Instruction *Prev = BI; ++BI; - while (BI != BE) { - Instruction *Next = BI; ++BI; - DbgInfoIntrinsic *DBI_Prev = dyn_cast<DbgInfoIntrinsic>(Prev); - if (!DBI_Prev) { - Prev = Next; - continue; - } - - // If there are two consecutive llvm.dbg.stoppoint calls then - // it is likely that the optimizer deleted code in between these - // two intrinsics. - DbgInfoIntrinsic *DBI_Next = dyn_cast<DbgInfoIntrinsic>(Next); - if (DBI_Next - && DBI_Prev->getIntrinsicID() == llvm::Intrinsic::dbg_stoppoint - && DBI_Next->getIntrinsicID() == llvm::Intrinsic::dbg_stoppoint) - Prev->eraseFromParent(); - - // If a llvm.dbg.stoppoint is placed just before an unconditional - // branch then remove the llvm.dbg.stoppoint intrinsic. - else if (BranchInst *UC = dyn_cast<BranchInst>(Next)) { - if (UC->isUnconditional() - && DBI_Prev->getIntrinsicID() == llvm::Intrinsic::dbg_stoppoint) - Prev->eraseFromParent(); - } - - Prev = Next; - } -} - -/// RemoveDeadDbgIntrinsics - Remove dead dbg intrinsics from this function. -void llvm::RemoveDeadDbgIntrinsics(Function &F) { - for (Function::iterator FI = F.begin(), FE = F.end(); - FI != FE; ++FI) - RemoveDeadDbgIntrinsics(*FI); -} |