Debug Info: pass in VTableHolder as DIType instead of MDNode *.

Remove one cast and improve readability. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren 2013-09-06 23:54:23 +00:00
parent 997c5dead8
commit 8b56ca61e1
2 changed files with 9 additions and 8 deletions

View File

@ -17,6 +17,7 @@
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include "llvm/Support/ValueHandle.h" #include "llvm/Support/ValueHandle.h"
@ -288,7 +289,7 @@ namespace llvm {
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t SizeInBits, uint64_t AlignInBits,
uint64_t OffsetInBits, unsigned Flags, uint64_t OffsetInBits, unsigned Flags,
DIType DerivedFrom, DIArray Elements, DIType DerivedFrom, DIArray Elements,
MDNode *VTableHolder = 0, DIType VTableHolder = NULL,
MDNode *TemplateParms = 0, MDNode *TemplateParms = 0,
StringRef UniqueIdentifier = StringRef()); StringRef UniqueIdentifier = StringRef());
@ -308,7 +309,7 @@ namespace llvm {
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t SizeInBits, uint64_t AlignInBits,
unsigned Flags, DIType DerivedFrom, unsigned Flags, DIType DerivedFrom,
DIArray Elements, unsigned RunTimeLang = 0, DIArray Elements, unsigned RunTimeLang = 0,
MDNode *VTableHolder = 0, DIType VTableHolder = NULL,
StringRef UniqueIdentifier = StringRef()); StringRef UniqueIdentifier = StringRef());
/// createUnionType - Create debugging information entry for an union. /// createUnionType - Create debugging information entry for an union.
@ -586,7 +587,7 @@ namespace llvm {
DICompositeType Ty, bool isLocalToUnit, DICompositeType Ty, bool isLocalToUnit,
bool isDefinition, bool isDefinition,
unsigned Virtuality = 0, unsigned VTableIndex = 0, unsigned Virtuality = 0, unsigned VTableIndex = 0,
MDNode *VTableHolder = 0, DIType VTableHolder = NULL,
unsigned Flags = 0, unsigned Flags = 0,
bool isOptimized = false, bool isOptimized = false,
Function *Fn = 0, Function *Fn = 0,

View File

@ -607,7 +607,7 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
uint64_t OffsetInBits, uint64_t OffsetInBits,
unsigned Flags, DIType DerivedFrom, unsigned Flags, DIType DerivedFrom,
DIArray Elements, DIArray Elements,
MDNode *VTableHolder, DIType VTableHolder,
MDNode *TemplateParams, MDNode *TemplateParams,
StringRef UniqueIdentifier) { StringRef UniqueIdentifier) {
assert((!Context || Context.isScope() || Context.isType()) && assert((!Context || Context.isScope() || Context.isType()) &&
@ -626,7 +626,7 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
DerivedFrom, DerivedFrom,
Elements, Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), 0), ConstantInt::get(Type::getInt32Ty(VMContext), 0),
DIType(VTableHolder).generateRef(), VTableHolder.generateRef(),
TemplateParams, TemplateParams,
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier) UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
}; };
@ -647,7 +647,7 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
unsigned Flags, DIType DerivedFrom, unsigned Flags, DIType DerivedFrom,
DIArray Elements, DIArray Elements,
unsigned RunTimeLang, unsigned RunTimeLang,
MDNode *VTableHolder, DIType VTableHolder,
StringRef UniqueIdentifier) { StringRef UniqueIdentifier) {
// TAG_structure_type is encoded in DICompositeType format. // TAG_structure_type is encoded in DICompositeType format.
Value *Elts[] = { Value *Elts[] = {
@ -663,7 +663,7 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
DerivedFrom, DerivedFrom,
Elements, Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang), ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
DIType(VTableHolder).generateRef(), VTableHolder.generateRef(),
NULL, NULL,
UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier) UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
}; };
@ -1104,7 +1104,7 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
bool isLocalToUnit, bool isLocalToUnit,
bool isDefinition, bool isDefinition,
unsigned VK, unsigned VIndex, unsigned VK, unsigned VIndex,
MDNode *VTableHolder, DIType VTableHolder,
unsigned Flags, unsigned Flags,
bool isOptimized, bool isOptimized,
Function *Fn, Function *Fn,