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 | bea08d1c85509ee2ede36bbfff129d1f93c05c50 (patch) | |
tree | e5726a2fb028b8017ed05d800db9d0730a3d2a89 /llvm/lib | |
parent | 0574cc556ac6946c125fa4927c36be0ca319bc35 (diff) | |
download | bcm5719-llvm-bea08d1c85509ee2ede36bbfff129d1f93c05c50.tar.gz bcm5719-llvm-bea08d1c85509ee2ede36bbfff129d1f93c05c50.zip |
Let FE mark a variable as artificial variable.
llvm-svn: 115102
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index b168625010d..06a66d5539e 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/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 diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d3e343c3087..e6ac0ebc2da 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1624,6 +1624,8 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) { if (Tag == dwarf::DW_TAG_formal_parameter && DV->getType().isArtificial()) addUInt(VariableDie, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, 1); + else if (DIVariable(DV->getVariable()).isArtificial()) + addUInt(VariableDie, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, 1); if (Scope->isAbstractScope()) { DV->setDIE(VariableDie); |