mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Add support to encode type info using llvm::Constant.
Patch by Talin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
440e251c75
commit
ac16d44e58
@ -514,6 +514,13 @@ namespace llvm {
|
||||
uint64_t OffsetInBits, unsigned Flags,
|
||||
unsigned Encoding);
|
||||
|
||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||
DIBasicType CreateBasicTypeEx(DIDescriptor Context, StringRef Name,
|
||||
DICompileUnit CompileUnit, unsigned LineNumber,
|
||||
Constant *SizeInBits, Constant *AlignInBits,
|
||||
Constant *OffsetInBits, unsigned Flags,
|
||||
unsigned Encoding);
|
||||
|
||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||
/// pointer, typedef, etc.
|
||||
DIDerivedType CreateDerivedType(unsigned Tag, DIDescriptor Context,
|
||||
@ -524,6 +531,16 @@ namespace llvm {
|
||||
uint64_t OffsetInBits, unsigned Flags,
|
||||
DIType DerivedFrom);
|
||||
|
||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||
/// pointer, typedef, etc.
|
||||
DIDerivedType CreateDerivedTypeEx(unsigned Tag, DIDescriptor Context,
|
||||
StringRef Name,
|
||||
DICompileUnit CompileUnit,
|
||||
unsigned LineNumber,
|
||||
Constant *SizeInBits, Constant *AlignInBits,
|
||||
Constant *OffsetInBits, unsigned Flags,
|
||||
DIType DerivedFrom);
|
||||
|
||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||
DICompositeType CreateCompositeType(unsigned Tag, DIDescriptor Context,
|
||||
StringRef Name,
|
||||
@ -536,6 +553,18 @@ namespace llvm {
|
||||
DIArray Elements,
|
||||
unsigned RunTimeLang = 0);
|
||||
|
||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||
DICompositeType CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context,
|
||||
StringRef Name,
|
||||
DICompileUnit CompileUnit,
|
||||
unsigned LineNumber,
|
||||
Constant *SizeInBits,
|
||||
Constant *AlignInBits,
|
||||
Constant *OffsetInBits, unsigned Flags,
|
||||
DIType DerivedFrom,
|
||||
DIArray Elements,
|
||||
unsigned RunTimeLang = 0);
|
||||
|
||||
/// CreateSubprogram - Create a new descriptor for the specified subprogram.
|
||||
/// See comments in DISubprogram for descriptions of these fields.
|
||||
DISubprogram CreateSubprogram(DIDescriptor Context, StringRef Name,
|
||||
|
@ -695,6 +695,32 @@ DIBasicType DIFactory::CreateBasicType(DIDescriptor Context,
|
||||
return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
|
||||
}
|
||||
|
||||
|
||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||
DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context,
|
||||
StringRef Name,
|
||||
DICompileUnit CompileUnit,
|
||||
unsigned LineNumber,
|
||||
Constant *SizeInBits,
|
||||
Constant *AlignInBits,
|
||||
Constant *OffsetInBits, unsigned Flags,
|
||||
unsigned Encoding) {
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(dwarf::DW_TAG_base_type),
|
||||
Context.getNode(),
|
||||
MDString::get(VMContext, Name),
|
||||
CompileUnit.getNode(),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||
SizeInBits,
|
||||
AlignInBits,
|
||||
OffsetInBits,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Encoding)
|
||||
};
|
||||
return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
|
||||
}
|
||||
|
||||
|
||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||
/// pointer, typedef, etc.
|
||||
DIDerivedType DIFactory::CreateDerivedType(unsigned Tag,
|
||||
@ -722,6 +748,35 @@ DIDerivedType DIFactory::CreateDerivedType(unsigned Tag,
|
||||
return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10));
|
||||
}
|
||||
|
||||
|
||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||
/// pointer, typedef, etc.
|
||||
DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag,
|
||||
DIDescriptor Context,
|
||||
StringRef Name,
|
||||
DICompileUnit CompileUnit,
|
||||
unsigned LineNumber,
|
||||
Constant *SizeInBits,
|
||||
Constant *AlignInBits,
|
||||
Constant *OffsetInBits,
|
||||
unsigned Flags,
|
||||
DIType DerivedFrom) {
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(Tag),
|
||||
Context.getNode(),
|
||||
MDString::get(VMContext, Name),
|
||||
CompileUnit.getNode(),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||
SizeInBits,
|
||||
AlignInBits,
|
||||
OffsetInBits,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
||||
DerivedFrom.getNode(),
|
||||
};
|
||||
return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10));
|
||||
}
|
||||
|
||||
|
||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||
DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
|
||||
DIDescriptor Context,
|
||||
@ -754,6 +809,38 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
|
||||
}
|
||||
|
||||
|
||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||
DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,
|
||||
DIDescriptor Context,
|
||||
StringRef Name,
|
||||
DICompileUnit CompileUnit,
|
||||
unsigned LineNumber,
|
||||
Constant *SizeInBits,
|
||||
Constant *AlignInBits,
|
||||
Constant *OffsetInBits,
|
||||
unsigned Flags,
|
||||
DIType DerivedFrom,
|
||||
DIArray Elements,
|
||||
unsigned RuntimeLang) {
|
||||
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(Tag),
|
||||
Context.getNode(),
|
||||
MDString::get(VMContext, Name),
|
||||
CompileUnit.getNode(),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||
SizeInBits,
|
||||
AlignInBits,
|
||||
OffsetInBits,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
||||
DerivedFrom.getNode(),
|
||||
Elements.getNode(),
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
|
||||
};
|
||||
return DICompositeType(MDNode::get(VMContext, &Elts[0], 12));
|
||||
}
|
||||
|
||||
|
||||
/// CreateSubprogram - Create a new descriptor for the specified subprogram.
|
||||
/// See comments in DISubprogram for descriptions of these fields. This
|
||||
/// method does not unique the generated descriptors.
|
||||
|
Loading…
x
Reference in New Issue
Block a user