mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
DIBuilder: take an optional StringRef to pass in unique identifier.
createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will take an optional StringRef to pass in the unique identifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -599,7 +599,8 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
||||
unsigned Flags, DIType DerivedFrom,
|
||||
DIArray Elements,
|
||||
MDNode *VTableHolder,
|
||||
MDNode *TemplateParams) {
|
||||
MDNode *TemplateParams,
|
||||
StringRef UniqueIdentifier) {
|
||||
assert((!Context || Context.isScope() || Context.isType()) &&
|
||||
"createClassType should be called with a valid Context");
|
||||
// TAG_class_type is encoded in DICompositeType format.
|
||||
@@ -618,7 +619,7 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||
VTableHolder,
|
||||
TemplateParams,
|
||||
NULL // Type Identifer
|
||||
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
|
||||
};
|
||||
DICompositeType R(MDNode::get(VMContext, Elts));
|
||||
assert(R.isCompositeType() &&
|
||||
@@ -635,7 +636,8 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
|
||||
unsigned Flags, DIType DerivedFrom,
|
||||
DIArray Elements,
|
||||
unsigned RunTimeLang,
|
||||
MDNode *VTableHolder) {
|
||||
MDNode *VTableHolder,
|
||||
StringRef UniqueIdentifier) {
|
||||
// TAG_structure_type is encoded in DICompositeType format.
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_structure_type),
|
||||
@@ -652,7 +654,7 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
|
||||
VTableHolder,
|
||||
NULL,
|
||||
NULL // Type Identifer
|
||||
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
|
||||
};
|
||||
DICompositeType R(MDNode::get(VMContext, Elts));
|
||||
assert(R.isCompositeType() &&
|
||||
@@ -666,7 +668,8 @@ DICompositeType DIBuilder::createUnionType(DIDescriptor Scope, StringRef Name,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Flags,
|
||||
DIArray Elements,
|
||||
unsigned RunTimeLang) {
|
||||
unsigned RunTimeLang,
|
||||
StringRef UniqueIdentifier) {
|
||||
// TAG_union_type is encoded in DICompositeType format.
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_union_type),
|
||||
@@ -683,7 +686,7 @@ DICompositeType DIBuilder::createUnionType(DIDescriptor Scope, StringRef Name,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL // Type Identifer
|
||||
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
|
||||
};
|
||||
return DICompositeType(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
@@ -717,7 +720,7 @@ DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) {
|
||||
DICompositeType DIBuilder::createEnumerationType(
|
||||
DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements,
|
||||
DIType UnderlyingType) {
|
||||
DIType UnderlyingType, StringRef UniqueIdentifier) {
|
||||
// TAG_enumeration_type is encoded in DICompositeType format.
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
|
||||
@@ -734,7 +737,7 @@ DICompositeType DIBuilder::createEnumerationType(
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL // Type Identifer
|
||||
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
|
||||
};
|
||||
MDNode *Node = MDNode::get(VMContext, Elts);
|
||||
AllEnumTypes.push_back(Node);
|
||||
@@ -859,7 +862,8 @@ DICompositeType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
|
||||
DIDescriptor Scope, DIFile F,
|
||||
unsigned Line, unsigned RuntimeLang,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits) {
|
||||
uint64_t AlignInBits,
|
||||
StringRef UniqueIdentifier) {
|
||||
// Create a temporary MDNode.
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, Tag),
|
||||
@@ -877,7 +881,7 @@ DICompositeType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang),
|
||||
NULL,
|
||||
NULL, //TemplateParams
|
||||
NULL // Type Identifer
|
||||
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
|
||||
};
|
||||
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
|
||||
DICompositeType RetTy(Node);
|
||||
|
Reference in New Issue
Block a user