aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-08-26 22:39:55 +0000
committerManman Ren <manman.ren@gmail.com>2013-08-26 22:39:55 +0000
commit6e3cd0ebe22a7cc959ed301de7f2f09d7a9307c8 (patch)
tree8aaac55e738c68b9d74e97ab921cb0a46b41ba87 /lib/IR/DIBuilder.cpp
parent4bf6326d0871961a7402c797a0399a2bdaf53574 (diff)
downloadexternal_llvm-6e3cd0ebe22a7cc959ed301de7f2f09d7a9307c8.tar.gz
external_llvm-6e3cd0ebe22a7cc959ed301de7f2f09d7a9307c8.tar.bz2
external_llvm-6e3cd0ebe22a7cc959ed301de7f2f09d7a9307c8.zip
Debug Info: add an identifier field to DICompositeType.
DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r--lib/IR/DIBuilder.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 665e16ea8a..7027813b81 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -617,7 +617,8 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
VTableHolder,
- TemplateParams
+ TemplateParams,
+ NULL // Type Identifer
};
DICompositeType R(MDNode::get(VMContext, Elts));
assert(R.isCompositeType() &&
@@ -651,6 +652,7 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
VTableHolder,
NULL,
+ NULL // Type Identifer
};
DICompositeType R(MDNode::get(VMContext, Elts));
assert(R.isCompositeType() &&
@@ -679,8 +681,9 @@ DICompositeType DIBuilder::createUnionType(DIDescriptor Scope, StringRef Name,
NULL,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
- Constant::getNullValue(Type::getInt32Ty(VMContext)),
- NULL
+ NULL,
+ NULL,
+ NULL // Type Identifer
};
return DICompositeType(MDNode::get(VMContext, Elts));
}
@@ -702,7 +705,9 @@ DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) {
NULL,
ParameterTypes,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
- Constant::getNullValue(Type::getInt32Ty(VMContext))
+ NULL,
+ NULL,
+ NULL // Type Identifer
};
return DICompositeType(MDNode::get(VMContext, Elts));
}
@@ -727,7 +732,9 @@ DICompositeType DIBuilder::createEnumerationType(
UnderlyingType,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
- Constant::getNullValue(Type::getInt32Ty(VMContext))
+ NULL,
+ NULL,
+ NULL // Type Identifer
};
MDNode *Node = MDNode::get(VMContext, Elts);
AllEnumTypes.push_back(Node);
@@ -751,7 +758,9 @@ DICompositeType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
Ty,
Subscripts,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
- Constant::getNullValue(Type::getInt32Ty(VMContext))
+ NULL,
+ NULL,
+ NULL // Type Identifer
};
return DICompositeType(MDNode::get(VMContext, Elts));
}
@@ -773,7 +782,9 @@ DICompositeType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits,
Ty,
Subscripts,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
- Constant::getNullValue(Type::getInt32Ty(VMContext))
+ NULL,
+ NULL,
+ NULL // Type Identifer
};
return DICompositeType(MDNode::get(VMContext, Elts));
}
@@ -864,7 +875,9 @@ DICompositeType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
NULL,
DIArray(),
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang),
- NULL
+ NULL,
+ NULL, //TemplateParams
+ NULL // Type Identifer
};
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
DICompositeType RetTy(Node);