mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Set DW_AT_artificial only if argument is marked as artificial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95461 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -725,6 +725,29 @@ DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context,
|
||||
return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
|
||||
}
|
||||
|
||||
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
||||
DIType DIFactory::CreateArtificialType(DIType Ty) {
|
||||
if (Ty.isArtificial())
|
||||
return Ty;
|
||||
|
||||
SmallVector<Value *, 9> Elts;
|
||||
MDNode *N = Ty.getNode();
|
||||
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::FlagArtificial;
|
||||
|
||||
// Flags are stored at this slot.
|
||||
Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
|
||||
|
||||
return DIType(MDNode::get(VMContext, Elts.data(), Elts.size()));
|
||||
}
|
||||
|
||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||
/// pointer, typedef, etc.
|
||||
|
||||
Reference in New Issue
Block a user