Debug info: split out complex DIVariable address expressions into a

separate MDNode so they can be uniqued via folding set magic. To conserve
space, DIVariable nodes are still variable-length, with the last two
fields being optional.

No functional change.
http://reviews.llvm.org/D3526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2014-06-30 17:17:35 +00:00
parent e6cfdc8471
commit 93b97c9a57
12 changed files with 61 additions and 32 deletions
+13 -12
View File
@@ -1075,18 +1075,19 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
DITypeRef Ty,
ArrayRef<Value *> Addr,
unsigned ArgNo) {
SmallVector<Value *, 15> Elts;
Elts.push_back(GetTagConstant(VMContext, Tag));
Elts.push_back(getNonCompileUnitScope(Scope)),
Elts.push_back(MDString::get(VMContext, Name));
Elts.push_back(F);
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext),
(LineNo | (ArgNo << 24))));
Elts.push_back(Ty);
Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext)));
Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext)));
Elts.append(Addr.begin(), Addr.end());
assert(Addr.size() > 0 && "complex address is empty");
Value *Elts[] = {
GetTagConstant(VMContext, Tag),
getNonCompileUnitScope(Scope),
MDString::get(VMContext, Name),
F,
ConstantInt::get(Type::getInt32Ty(VMContext),
(LineNo | (ArgNo << 24))),
Ty,
Constant::getNullValue(Type::getInt32Ty(VMContext)),
Constant::getNullValue(Type::getInt32Ty(VMContext)),
MDNode::get(VMContext, Addr)
};
return DIVariable(MDNode::get(VMContext, Elts));
}