diff options
author | Devang Patel <dpatel@apple.com> | 2009-06-26 22:53:22 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-06-26 22:53:22 +0000 |
commit | f3fac8e958a35a4d51a96dcfb94fd33942d652c3 (patch) | |
tree | 6f2312e9d71b4e1aa80e0d7af19a444e02b251e6 | |
parent | 8bf22bc4199148e82366a3369760880fdd12c122 (diff) | |
download | external_llvm-f3fac8e958a35a4d51a96dcfb94fd33942d652c3.zip external_llvm-f3fac8e958a35a4d51a96dcfb94fd33942d652c3.tar.gz external_llvm-f3fac8e958a35a4d51a96dcfb94fd33942d652c3.tar.bz2 |
Remove unused routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74351 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 7 | ||||
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 41 |
2 files changed, 0 insertions, 48 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 7ab8721..98a68f6 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -114,13 +114,6 @@ AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = 0); bool OnlyUsedByDbgInfoIntrinsics(Instruction *I, SmallVectorImpl<DbgInfoIntrinsic *> *DbgInUses = 0); -/// UserIsDebugInfo - Return true if U is a constant expr used by -/// llvm.dbg.variable or llvm.dbg.global_variable -bool UserIsDebugInfo(User *U); - -/// RemoveDbgInfoUser - Remove an User which is representing debug info. -void RemoveDbgInfoUser(User *U); - } // End llvm namespace #endif diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index c7fff54..8c08638 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -340,44 +340,3 @@ bool llvm::OnlyUsedByDbgInfoIntrinsics(Instruction *I, return true; } -/// UserIsDebugInfo - Return true if U is a constant expr used by -/// llvm.dbg.variable or llvm.dbg.global_variable -bool llvm::UserIsDebugInfo(User *U) { - ConstantExpr *CE = dyn_cast<ConstantExpr>(U); - - if (!CE || CE->getNumUses() != 1) - return false; - - Constant *Init = dyn_cast<Constant>(CE->use_back()); - if (!Init || Init->getNumUses() != 1) - return false; - - GlobalVariable *GV = dyn_cast<GlobalVariable>(Init->use_back()); - if (!GV || !GV->hasInitializer() || GV->getInitializer() != Init) - return false; - - DIVariable DV(GV); - if (!DV.isNull()) - return true; // User is llvm.dbg.variable - - DIGlobalVariable DGV(GV); - if (!DGV.isNull()) - return true; // User is llvm.dbg.global_variable - - return false; -} - -/// RemoveDbgInfoUser - Remove an User which is representing debug info. -void llvm::RemoveDbgInfoUser(User *U) { - assert (UserIsDebugInfo(U) && "Unexpected User!"); - ConstantExpr *CE = cast<ConstantExpr>(U); - while (!CE->use_empty()) { - Constant *C = cast<Constant>(CE->use_back()); - while (!C->use_empty()) { - GlobalVariable *GV = cast<GlobalVariable>(C->use_back()); - GV->eraseFromParent(); - } - C->destroyConstant(); - } - CE->destroyConstant(); -} |