summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-05 01:10:40 +0000
committerDevang Patel <dpatel@apple.com>2010-01-05 01:10:40 +0000
commitbe94f23992995b07fc79f6d8c580dbf12538fbcc (patch)
treece38c323ea32687905edeb22bc91a2c101b1d20a /llvm/lib/VMCore
parent43324d0b29b55bc13c835079f710a986cb85c633 (diff)
downloadbcm5719-llvm-be94f23992995b07fc79f6d8c580dbf12538fbcc.tar.gz
bcm5719-llvm-be94f23992995b07fc79f6d8c580dbf12538fbcc.zip
Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start AutoUpgrade simply ignores these intrinsics now. llvm-svn: 92557
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/AutoUpgrade.cpp54
-rw-r--r--llvm/lib/VMCore/IntrinsicInst.cpp22
2 files changed, 18 insertions, 58 deletions
diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp
index 77ab19f417c..0676caa2c64 100644
--- a/llvm/lib/VMCore/AutoUpgrade.cpp
+++ b/llvm/lib/VMCore/AutoUpgrade.cpp
@@ -486,55 +486,35 @@ void llvm::CheckDebugInfoIntrinsics(Module *M) {
if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) {
- if (!FuncStart->use_empty()) {
- DbgFuncStartInst *DFSI = cast<DbgFuncStartInst>(FuncStart->use_back());
- if (!isa<MDNode>(DFSI->getOperand(1))) {
- while (!FuncStart->use_empty()) {
- CallInst *CI = cast<CallInst>(FuncStart->use_back());
- CI->eraseFromParent();
- }
- FuncStart->eraseFromParent();
- }
+ while (!FuncStart->use_empty()) {
+ CallInst *CI = cast<CallInst>(FuncStart->use_back());
+ CI->eraseFromParent();
}
+ FuncStart->eraseFromParent();
}
-
+
if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) {
- if (!StopPoint->use_empty()) {
- DbgStopPointInst *DSPI = cast<DbgStopPointInst>(StopPoint->use_back());
- if (!isa<MDNode>(DSPI->getOperand(3))) {
- while (!StopPoint->use_empty()) {
- CallInst *CI = cast<CallInst>(StopPoint->use_back());
- CI->eraseFromParent();
- }
- StopPoint->eraseFromParent();
- }
+ while (!StopPoint->use_empty()) {
+ CallInst *CI = cast<CallInst>(StopPoint->use_back());
+ CI->eraseFromParent();
}
+ StopPoint->eraseFromParent();
}
if (Function *RegionStart = M->getFunction("llvm.dbg.region.start")) {
- if (!RegionStart->use_empty()) {
- DbgRegionStartInst *DRSI = cast<DbgRegionStartInst>(RegionStart->use_back());
- if (!isa<MDNode>(DRSI->getOperand(1))) {
- while (!RegionStart->use_empty()) {
- CallInst *CI = cast<CallInst>(RegionStart->use_back());
- CI->eraseFromParent();
- }
- RegionStart->eraseFromParent();
- }
+ while (!RegionStart->use_empty()) {
+ CallInst *CI = cast<CallInst>(RegionStart->use_back());
+ CI->eraseFromParent();
}
+ RegionStart->eraseFromParent();
}
if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) {
- if (!RegionEnd->use_empty()) {
- DbgRegionEndInst *DREI = cast<DbgRegionEndInst>(RegionEnd->use_back());
- if (!isa<MDNode>(DREI->getOperand(1))) {
- while (!RegionEnd->use_empty()) {
- CallInst *CI = cast<CallInst>(RegionEnd->use_back());
- CI->eraseFromParent();
- }
- RegionEnd->eraseFromParent();
- }
+ while (!RegionEnd->use_empty()) {
+ CallInst *CI = cast<CallInst>(RegionEnd->use_back());
+ CI->eraseFromParent();
}
+ RegionEnd->eraseFromParent();
}
if (Function *Declare = M->getFunction("llvm.dbg.declare")) {
diff --git a/llvm/lib/VMCore/IntrinsicInst.cpp b/llvm/lib/VMCore/IntrinsicInst.cpp
index 5e0f42e063b..daa768c0cfe 100644
--- a/llvm/lib/VMCore/IntrinsicInst.cpp
+++ b/llvm/lib/VMCore/IntrinsicInst.cpp
@@ -8,11 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file implements methods that make it really easy to deal with intrinsic
-// functions with the isa/dyncast family of functions. In particular, this
-// allows you to do things like:
-//
-// if (DbgStopPointInst *SPI = dyn_cast<DbgStopPointInst>(Inst))
-// ... SPI->getFileName() ... SPI->getDirectory() ...
+// functions.
//
// All intrinsic function calls are instances of the call instruction, so these
// are all subclasses of the CallInst class. Note that none of these classes
@@ -55,22 +51,6 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) {
}
//===----------------------------------------------------------------------===//
-/// DbgStopPointInst - This represents the llvm.dbg.stoppoint instruction.
-///
-
-Value *DbgStopPointInst::getFileName() const {
- // Once the operand indices are verified, update this assert
- assert(LLVMDebugVersion == (7 << 16) && "Verify operand indices");
- return getContext()->getOperand(3);
-}
-
-Value *DbgStopPointInst::getDirectory() const {
- // Once the operand indices are verified, update this assert
- assert(LLVMDebugVersion == (7 << 16) && "Verify operand indices");
- return getContext()->getOperand(4);
-}
-
-//===----------------------------------------------------------------------===//
/// DbgValueInst - This represents the llvm.dbg.value instruction.
///
OpenPOWER on IntegriCloud