[llvm] r178091 - Make DIBuilder::createClassType more type safe by returning DICompositeType rather than DIType
David Blaikie
dblaikie at gmail.com
Tue Mar 26 16:46:39 PDT 2013
Author: dblaikie
Date: Tue Mar 26 18:46:39 2013
New Revision: 178091
URL: http://llvm.org/viewvc/llvm-project?rev=178091&view=rev
Log:
Make DIBuilder::createClassType more type safe by returning DICompositeType rather than DIType
Modified:
llvm/trunk/include/llvm/DIBuilder.h
llvm/trunk/lib/IR/DIBuilder.cpp
Modified: llvm/trunk/include/llvm/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DIBuilder.h?rev=178091&r1=178090&r2=178091&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/DIBuilder.h Tue Mar 26 18:46:39 2013
@@ -265,12 +265,13 @@ namespace llvm {
/// DW_AT_containing_type. See DWARF documentation
/// for more info.
/// @param TemplateParms Template type parameters.
- DIType createClassType(DIDescriptor Scope, StringRef Name, DIFile File,
- unsigned LineNumber, uint64_t SizeInBits,
- uint64_t AlignInBits, uint64_t OffsetInBits,
- unsigned Flags, DIType DerivedFrom,
- DIArray Elements, MDNode *VTableHolder = 0,
- MDNode *TemplateParms = 0);
+ DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
+ DIFile File, unsigned LineNumber,
+ uint64_t SizeInBits, uint64_t AlignInBits,
+ uint64_t OffsetInBits, unsigned Flags,
+ DIType DerivedFrom, DIArray Elements,
+ MDNode *VTableHolder = 0,
+ MDNode *TemplateParms = 0);
/// createStructType - Create debugging information entry for a struct.
/// @param Scope Scope in which this struct is defined.
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=178091&r1=178090&r2=178091&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Tue Mar 26 18:46:39 2013
@@ -482,13 +482,15 @@ DIBuilder::createTemplateValueParameter(
}
/// createClassType - Create debugging information entry for a class.
-DIType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
- DIFile File, unsigned LineNumber,
- uint64_t SizeInBits, uint64_t AlignInBits,
- uint64_t OffsetInBits, unsigned Flags,
- DIType DerivedFrom, DIArray Elements,
- MDNode *VTableHolder,
- MDNode *TemplateParams) {
+DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
+ DIFile File, unsigned LineNumber,
+ uint64_t SizeInBits,
+ uint64_t AlignInBits,
+ uint64_t OffsetInBits,
+ unsigned Flags, DIType DerivedFrom,
+ DIArray Elements,
+ MDNode *VTableHolder,
+ MDNode *TemplateParams) {
assert((!Context || Context.Verify()) &&
"createClassType should be called with a valid Context");
// TAG_class_type is encoded in DICompositeType format.
@@ -508,7 +510,7 @@ DIType DIBuilder::createClassType(DIDesc
VTableHolder,
TemplateParams
};
- DIType R(MDNode::get(VMContext, Elts));
+ DICompositeType R(MDNode::get(VMContext, Elts));
assert(R.Verify() && "createClassType should return a verifiable DIType");
return R;
}
More information about the llvm-commits
mailing list