diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-29 23:07:21 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-29 23:07:21 +0000 |
commit | 3cf763dc7a9741c14432710943ab66b439562881 (patch) | |
tree | b5d85ac49c63a6635450bd851141384b1bfc78dd /lib/Analysis/DebugInfo.cpp | |
parent | e487b017e94393ec4e90e8bb02818cab39190787 (diff) |
Let FE mark a variable as artificial variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index b168625010..06a66d5539 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -109,7 +109,9 @@ Function *DIDescriptor::getFunctionField(unsigned Elt) const { } unsigned DIVariable::getNumAddrElements() const { - return DbgNode->getNumOperands()-6; + if (getVersion() <= llvm::LLVMDebugVersion8) + return DbgNode->getNumOperands()-6; + return DbgNode->getNumOperands()-7; } @@ -1145,7 +1147,8 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context, StringRef Name, DIFile F, unsigned LineNo, - DIType Ty, bool AlwaysPreserve) { + DIType Ty, bool AlwaysPreserve, + unsigned Flags) { Value *Elts[] = { GetTagConstant(Tag), Context, @@ -1153,8 +1156,9 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context, F, ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), Ty, + ConstantInt::get(Type::getInt32Ty(VMContext), Flags) }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], 6); + MDNode *Node = MDNode::get(VMContext, &Elts[0], 7); if (AlwaysPreserve) { // The optimizer may remove local variable. If there is an interest // to preserve variable info in such situation then stash it in a |