diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:58:35 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 04:58:35 +0000 |
commit | db8dd5515de1061a688d35ca53087a61541a7eee (patch) | |
tree | 3516676dab8e1b6f108d1b45eab14c5a8c5b3c82 | |
parent | 2f8a5f3f44216ecfe1452ce5fa68903eced5b52f (diff) | |
download | bcm5719-llvm-db8dd5515de1061a688d35ca53087a61541a7eee.tar.gz bcm5719-llvm-db8dd5515de1061a688d35ca53087a61541a7eee.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@91177308-0d34-0410-b5e6-96231b3b80d8>
llvm-svn: 269540
-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..1d3c8299255 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 (isa<DbgInfoIntrinsic>(&I)) { + I.eraseFromParent(); Changed = true; continue; } |