diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-15 19:04:09 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-15 19:04:09 +0000 |
commit | b324e66f4c2ad19df026505209ec609a63ca9692 (patch) | |
tree | 555a16a52dc90f8724557409e2800b9aab9d8e45 /llvm/lib/VMCore/IntrinsicInst.cpp | |
parent | fb85dddba0be0a0cafd927b5510f1c00ed7fe976 (diff) | |
download | bcm5719-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/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/VMCore/IntrinsicInst.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/IntrinsicInst.cpp b/llvm/lib/VMCore/IntrinsicInst.cpp index cb9252efdf5..d8f015a9e2c 100644 --- a/llvm/lib/VMCore/IntrinsicInst.cpp +++ b/llvm/lib/VMCore/IntrinsicInst.cpp @@ -51,6 +51,17 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) { } //===----------------------------------------------------------------------===// +/// DbgDeclareInst - This represents the llvm.dbg.declare instruction. +/// + +Value *DbgDeclareInst::getAddress() const { + if (MDNode* MD = cast_or_null<MDNode>(getOperand(1))) + return MD->getOperand(0); + else + return NULL; +} + +//===----------------------------------------------------------------------===// /// DbgValueInst - This represents the llvm.dbg.value instruction. /// |