mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user