diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-08-26 22:39:55 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-08-26 22:39:55 +0000 |
commit | 0ed70aeb85cb0bf00721015afdebb4b825dc6fa1 (patch) | |
tree | 58fe46e21c20d39039981811be3002b613eba9ea /llvm/lib/IR/DIBuilder.cpp | |
parent | bdc9ff449800079c194d30e919ca74ce15f64284 (diff) | |
download | bcm5719-llvm-0ed70aeb85cb0bf00721015afdebb4b825dc6fa1.tar.gz bcm5719-llvm-0ed70aeb85cb0bf00721015afdebb4b825dc6fa1.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.
llvm-svn: 189282
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 665e16ea8a7..7027813b814 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/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); |