summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2010-01-15 19:04:09 +0000
committerVictor Hernandez <vhernandez@apple.com>2010-01-15 19:04:09 +0000
commitb324e66f4c2ad19df026505209ec609a63ca9692 (patch)
tree555a16a52dc90f8724557409e2800b9aab9d8e45 /llvm/lib/VMCore/AutoUpgrade.cpp
parentfb85dddba0be0a0cafd927b5510f1c00ed7fe976 (diff)
downloadbcm5719-llvm-b324e66f4c2ad19df026505209ec609a63ca9692.tar.gz
bcm5719-llvm-b324e66f4c2ad19df026505209ec609a63ca9692.zip
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument. llvm-svn: 93531
Diffstat (limited to 'llvm/lib/VMCore/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/VMCore/AutoUpgrade.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp
index 216184188ad..5e4c9fb7662 100644
--- a/llvm/lib/VMCore/AutoUpgrade.cpp
+++ b/llvm/lib/VMCore/AutoUpgrade.cpp
@@ -521,7 +521,7 @@ void llvm::CheckDebugInfoIntrinsics(Module *M) {
if (Function *Declare = M->getFunction("llvm.dbg.declare")) {
if (!Declare->use_empty()) {
DbgDeclareInst *DDI = cast<DbgDeclareInst>(Declare->use_back());
- if (!isa<MDNode>(DDI->getOperand(2))) {
+ if (!isa<MDNode>(DDI->getOperand(1)) ||!isa<MDNode>(DDI->getOperand(2))) {
while (!Declare->use_empty()) {
CallInst *CI = cast<CallInst>(Declare->use_back());
CI->eraseFromParent();
OpenPOWER on IntegriCloud