diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:41:21 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:41:21 +0000 |
commit | ac85189998ca85761540bd4e8e6f643eb056e413 (patch) | |
tree | 8f34cf72816bb7911595d2ab4cc47361232048f5 | |
parent | cbe76a0df7d4c1c6f33888c173bb2c90a7a01f20 (diff) | |
download | bcm5719-llvm-ac85189998ca85761540bd4e8e6f643eb056e413.tar.gz bcm5719-llvm-ac85189998ca85761540bd4e8e6f643eb056e413.zip |
StripDebugInfo: uses isa<DbgInfoIntrinsic> instead of matching against llvm.dbg.* (NFC)
Suggested by Adrian. This is NFC right now but is more clean and
robust against future potential new debug info intrinsics.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269537
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 82ce8c95e78..7a91b662388 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -248,18 +248,11 @@ bool llvm::stripDebugInfo(Function &F) { F.setSubprogram(nullptr); } - Function *Declare = F.getParent()->getFunction("llvm.dbg.declare"); - Function *DbgVal = F.getParent()->getFunction("llvm.dbg.value"); for (BasicBlock &BB : F) { for (auto II = BB.begin(), End = BB.end(); II != End;) { Instruction &I = *II++; // We may delete the instruction, increment now. - // Remove all of the calls to the debugger intrinsics, and remove them - // from the module. - CallInst *CI = dyn_cast<CallInst>(&I); - if (CI && CI->getCalledFunction() && - (CI->getCalledFunction() == Declare || - CI->getCalledFunction() == DbgVal)) { - CI->eraseFromParent(); + if (dyn_cast<DbgInfoIntrinsic>(&I)) { + I.eraseFromParent(); Changed = true; continue; } |