summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-08-27 23:06:40 +0000
committerManman Ren <manman.ren@gmail.com>2013-08-27 23:06:40 +0000
commit23f84cb1406b0f26f5bd808afa1828d427a40a2f (patch)
tree548c3a79427e5005e4460eee3bdad31041b02a85 /lib
parentffba4c7e69cd0d0ef346e9845b918a030ca51ae8 (diff)
downloadllvm-23f84cb1406b0f26f5bd808afa1828d427a40a2f.tar.gz
llvm-23f84cb1406b0f26f5bd808afa1828d427a40a2f.tar.bz2
llvm-23f84cb1406b0f26f5bd808afa1828d427a40a2f.tar.xz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/DIBuilder.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 7027813b81..505e5659f9 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -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);