diff options
author | Devang Patel <dpatel@apple.com> | 2011-07-20 22:18:50 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-07-20 22:18:50 +0000 |
commit | 8fb9fd6769b530eb05ab9e1db534948ed752a6e3 (patch) | |
tree | 274cea73ee1d766ea9bffc76b1a53c23518a74aa /llvm/lib/Analysis | |
parent | 911e12f50535689052dbe1f8cea5bd2f21a7ca3d (diff) | |
download | bcm5719-llvm-8fb9fd6769b530eb05ab9e1db534948ed752a6e3.tar.gz bcm5719-llvm-8fb9fd6769b530eb05ab9e1db534948ed752a6e3.zip |
There are two ways to map a variable to its lexical scope. Lexical scope information is embedded in MDNode describing the variable. It is also available as a part of DebugLoc attached with DBG_VALUE instruction. DebugLoc attached with an instruction is less reliable in optimized code so use information embedded in the MDNode.
llvm-svn: 135629
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 4dcf04ef216..dd85a4fcc80 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -116,6 +116,12 @@ unsigned DIVariable::getNumAddrElements() const { return DbgNode->getNumOperands()-8; } +/// getInlinedAt - If this variable is inlined then return inline location. +MDNode *DIVariable::getInlinedAt() { + if (getVersion() <= llvm::LLVMDebugVersion9) + return NULL; + return dyn_cast_or_null<MDNode>(DbgNode->getOperand(7)); +} //===----------------------------------------------------------------------===// // Predicates |