diff options
Diffstat (limited to 'include/llvm/IntrinsicInst.h')
-rw-r--r-- | include/llvm/IntrinsicInst.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index 151e434..f40e8cc 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -25,6 +25,7 @@ #define LLVM_INTRINSICINST_H #include "llvm/Constants.h" +#include "llvm/Metadata.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" @@ -82,7 +83,12 @@ namespace llvm { /// class DbgDeclareInst : public DbgInfoIntrinsic { public: - Value *getAddress() const { return getOperand(1); } + Value *getAddress() const { + if (MDNode* MD = dyn_cast<MDNode>(getOperand(1))) + return MD->getOperand(0); + else + return NULL; + } MDNode *getVariable() const { return cast<MDNode>(getOperand(2)); } // Methods for support type inquiry through isa, cast, and dyn_cast: |