mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Recommit, with fixes:
Add some support for dealing with an object pointer on arguments. Part of rdar://9797999 which now supports adding the object pointer attribute to the subprogram as it should. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -640,6 +640,30 @@ DIType DIBuilder::createArtificialType(DIType Ty) {
|
||||
return DIType(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
|
||||
/// createArtificialType - Create a new DIType with "artificial" flag set.
|
||||
DIType DIBuilder::createObjectPointerType(DIType Ty) {
|
||||
if (Ty.isObjectPointer())
|
||||
return Ty;
|
||||
|
||||
SmallVector<Value *, 9> Elts;
|
||||
MDNode *N = Ty;
|
||||
assert (N && "Unexpected input DIType!");
|
||||
for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
|
||||
if (Value *V = N->getOperand(i))
|
||||
Elts.push_back(V);
|
||||
else
|
||||
Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
||||
}
|
||||
|
||||
unsigned CurFlags = Ty.getFlags();
|
||||
CurFlags = CurFlags | (DIType::FlagObjectPointer | DIType::FlagArtificial);
|
||||
|
||||
// Flags are stored at this slot.
|
||||
Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
|
||||
|
||||
return DIType(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
|
||||
/// retainType - Retain DIType in a module even if it is not referenced
|
||||
/// through debug info anchors.
|
||||
void DIBuilder::retainType(DIType T) {
|
||||
|
Reference in New Issue
Block a user