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
This commit is contained in:
Devang Patel
2010-09-29 23:07:21 +00:00
parent e487b017e9
commit 3cf763dc7a
3 changed files with 18 additions and 4 deletions
+7 -3
View File
@@ -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