mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 05:30:49 +00:00
DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family and switching from uint64_t to uint32_t will save 4 bytes per variable. Differential Revision: https://reviews.llvm.org/D25620 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05fe9f3914
commit
58be60c483
@ -107,7 +107,7 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
|
||||
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Dref,
|
||||
const char *Name,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
unsigned Encoding) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createBasicType(Name, SizeInBits, AlignInBits, Encoding));
|
||||
@ -116,7 +116,7 @@ LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Dref,
|
||||
LLVMMetadataRef LLVMDIBuilderCreatePointerType(LLVMDIBuilderRef Dref,
|
||||
LLVMMetadataRef PointeeType,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
const char *Name) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createPointerType(unwrap<DIType>(PointeeType), SizeInBits,
|
||||
@ -134,7 +134,7 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref, LLVMMetadataRef File,
|
||||
LLVMMetadataRef LLVMDIBuilderCreateStructType(
|
||||
LLVMDIBuilderRef Dref, LLVMMetadataRef Scope, const char *Name,
|
||||
LLVMMetadataRef File, unsigned Line, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Flags, LLVMMetadataRef DerivedFrom,
|
||||
uint32_t AlignInBits, unsigned Flags, LLVMMetadataRef DerivedFrom,
|
||||
LLVMMetadataRef ElementTypes) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createStructType(
|
||||
@ -147,7 +147,7 @@ LLVMMetadataRef LLVMDIBuilderCreateStructType(
|
||||
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(
|
||||
LLVMDIBuilderRef Dref, unsigned Tag, const char *Name,
|
||||
LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
|
||||
unsigned RuntimeLang, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
unsigned Flags) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createReplaceableCompositeType(
|
||||
@ -160,7 +160,7 @@ LLVMMetadataRef
|
||||
LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef Dref, LLVMMetadataRef Scope,
|
||||
const char *Name, LLVMMetadataRef File,
|
||||
unsigned Line, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
unsigned Flags, LLVMMetadataRef Ty) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createMemberType(
|
||||
@ -171,7 +171,7 @@ LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef Dref, LLVMMetadataRef Scope,
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Dref,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
LLVMMetadataRef ElementType,
|
||||
LLVMMetadataRef Subscripts) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
|
@ -71,13 +71,13 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
|
||||
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef D,
|
||||
const char *Name,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
unsigned Encoding);
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreatePointerType(LLVMDIBuilderRef D,
|
||||
LLVMMetadataRef PointeeType,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
const char *Name);
|
||||
|
||||
LLVMMetadataRef
|
||||
@ -87,24 +87,24 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef D, LLVMMetadataRef File,
|
||||
LLVMMetadataRef LLVMDIBuilderCreateStructType(
|
||||
LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name,
|
||||
LLVMMetadataRef File, unsigned Line, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Flags, LLVMMetadataRef DerivedFrom,
|
||||
uint32_t AlignInBits, unsigned Flags, LLVMMetadataRef DerivedFrom,
|
||||
LLVMMetadataRef ElementTypes);
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(
|
||||
LLVMDIBuilderRef D, unsigned Tag, const char *Name, LLVMMetadataRef Scope,
|
||||
LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags);
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, unsigned Flags);
|
||||
|
||||
LLVMMetadataRef
|
||||
LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef D, LLVMMetadataRef Scope,
|
||||
const char *Name, LLVMMetadataRef File,
|
||||
unsigned Line, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
unsigned Flags, LLVMMetadataRef Ty);
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef D,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
LLVMMetadataRef ElementType,
|
||||
LLVMMetadataRef Subscripts);
|
||||
|
||||
|
@ -277,7 +277,7 @@ func (d *DIBuilder) CreateParameterVariable(scope Metadata, v DIParameterVariabl
|
||||
type DIBasicType struct {
|
||||
Name string
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64
|
||||
AlignInBits uint32
|
||||
Encoding DwarfTypeEncoding
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ func (d *DIBuilder) CreateBasicType(t DIBasicType) Metadata {
|
||||
d.ref,
|
||||
name,
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
C.unsigned(t.Encoding),
|
||||
)
|
||||
return Metadata{C: result}
|
||||
@ -299,7 +299,7 @@ func (d *DIBuilder) CreateBasicType(t DIBasicType) Metadata {
|
||||
type DIPointerType struct {
|
||||
Pointee Metadata
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64 // optional
|
||||
AlignInBits uint32 // optional
|
||||
Name string // optional
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ func (d *DIBuilder) CreatePointerType(t DIPointerType) Metadata {
|
||||
d.ref,
|
||||
t.Pointee.C,
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
name,
|
||||
)
|
||||
return Metadata{C: result}
|
||||
@ -340,7 +340,7 @@ type DIStructType struct {
|
||||
File Metadata
|
||||
Line int
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64
|
||||
AlignInBits uint32
|
||||
Flags int
|
||||
DerivedFrom Metadata
|
||||
Elements []Metadata
|
||||
@ -358,7 +358,7 @@ func (d *DIBuilder) CreateStructType(scope Metadata, t DIStructType) Metadata {
|
||||
t.File.C,
|
||||
C.unsigned(t.Line),
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
C.unsigned(t.Flags),
|
||||
t.DerivedFrom.C,
|
||||
elements.C,
|
||||
@ -375,7 +375,7 @@ type DIReplaceableCompositeType struct {
|
||||
Line int
|
||||
RuntimeLang int
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64
|
||||
AlignInBits uint32
|
||||
Flags int
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ func (d *DIBuilder) CreateReplaceableCompositeType(scope Metadata, t DIReplaceab
|
||||
C.unsigned(t.Line),
|
||||
C.unsigned(t.RuntimeLang),
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
C.unsigned(t.Flags),
|
||||
)
|
||||
return Metadata{C: result}
|
||||
@ -404,7 +404,7 @@ type DIMemberType struct {
|
||||
File Metadata
|
||||
Line int
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64
|
||||
AlignInBits uint32
|
||||
OffsetInBits uint64
|
||||
Flags int
|
||||
Type Metadata
|
||||
@ -421,7 +421,7 @@ func (d *DIBuilder) CreateMemberType(scope Metadata, t DIMemberType) Metadata {
|
||||
t.File.C,
|
||||
C.unsigned(t.Line),
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
C.uint64_t(t.OffsetInBits),
|
||||
C.unsigned(t.Flags),
|
||||
t.Type.C,
|
||||
@ -438,7 +438,7 @@ type DISubrange struct {
|
||||
// DIArrayType holds the values for creating array type debug metadata.
|
||||
type DIArrayType struct {
|
||||
SizeInBits uint64
|
||||
AlignInBits uint64
|
||||
AlignInBits uint32
|
||||
ElementType Metadata
|
||||
Subscripts []DISubrange
|
||||
}
|
||||
@ -453,7 +453,7 @@ func (d *DIBuilder) CreateArrayType(t DIArrayType) Metadata {
|
||||
result := C.LLVMDIBuilderCreateArrayType(
|
||||
d.ref,
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.uint64_t(t.AlignInBits),
|
||||
C.uint32_t(t.AlignInBits),
|
||||
t.ElementType.C,
|
||||
subscripts.C,
|
||||
)
|
||||
|
@ -123,7 +123,7 @@ namespace llvm {
|
||||
/// \param AlignInBits Type alignment.
|
||||
/// \param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
|
||||
DIBasicType *createBasicType(StringRef Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding);
|
||||
uint32_t AlignInBits, unsigned Encoding);
|
||||
|
||||
/// Create debugging information entry for a qualified
|
||||
/// type, e.g. 'const int'.
|
||||
@ -137,7 +137,7 @@ namespace llvm {
|
||||
/// \param AlignInBits Alignment. (optional)
|
||||
/// \param Name Pointer type name. (optional)
|
||||
DIDerivedType *createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits = 0,
|
||||
uint32_t AlignInBits = 0,
|
||||
StringRef Name = "");
|
||||
|
||||
/// Create debugging information entry for a pointer to member.
|
||||
@ -147,14 +147,14 @@ namespace llvm {
|
||||
/// \param Class Type for which this pointer points to members of.
|
||||
DIDerivedType *
|
||||
createMemberPointerType(DIType *PointeeTy, DIType *Class,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits = 0,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits = 0,
|
||||
DINode::DIFlags Flags = DINode::FlagZero);
|
||||
|
||||
/// Create debugging information entry for a c++
|
||||
/// style reference or rvalue reference type.
|
||||
DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
|
||||
uint64_t SizeInBits = 0,
|
||||
uint64_t AlignInBits = 0);
|
||||
uint32_t AlignInBits = 0);
|
||||
|
||||
/// Create debugging information entry for a typedef.
|
||||
/// \param Ty Original type.
|
||||
@ -191,7 +191,8 @@ namespace llvm {
|
||||
/// \param Ty Parent type.
|
||||
DIDerivedType *createMemberType(DIScope *Scope, StringRef Name,
|
||||
DIFile *File, unsigned LineNo,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits,
|
||||
uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags, DIType *Ty);
|
||||
|
||||
@ -208,7 +209,7 @@ namespace llvm {
|
||||
/// \param Ty Parent type.
|
||||
DIDerivedType *createBitFieldMemberType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty);
|
||||
|
||||
/// Create debugging information entry for a
|
||||
@ -237,7 +238,7 @@ namespace llvm {
|
||||
/// \param Ty Parent type.
|
||||
/// \param PropertyNode Property associated with this ivar.
|
||||
DIDerivedType *createObjCIVar(StringRef Name, DIFile *File, unsigned LineNo,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DINode::DIFlags Flags,
|
||||
DIType *Ty, MDNode *PropertyNode);
|
||||
|
||||
@ -274,7 +275,7 @@ namespace llvm {
|
||||
/// \param UniqueIdentifier A unique identifier for the class.
|
||||
DICompositeType *createClassType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
|
||||
DIType *VTableHolder = nullptr, MDNode *TemplateParms = nullptr,
|
||||
StringRef UniqueIdentifier = "");
|
||||
@ -292,7 +293,7 @@ namespace llvm {
|
||||
/// \param UniqueIdentifier A unique identifier for the struct.
|
||||
DICompositeType *createStructType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DINode::DIFlags Flags,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
|
||||
DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
|
||||
DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "");
|
||||
|
||||
@ -309,7 +310,7 @@ namespace llvm {
|
||||
/// \param UniqueIdentifier A unique identifier for the union.
|
||||
DICompositeType *createUnionType(DIScope *Scope, StringRef Name,
|
||||
DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
DINode::DIFlags Flags,
|
||||
DINodeArray Elements,
|
||||
unsigned RunTimeLang = 0,
|
||||
@ -359,7 +360,7 @@ namespace llvm {
|
||||
/// \param AlignInBits Alignment.
|
||||
/// \param Ty Element type.
|
||||
/// \param Subscripts Subscripts.
|
||||
DICompositeType *createArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||
DICompositeType *createArrayType(uint64_t Size, uint32_t AlignInBits,
|
||||
DIType *Ty, DINodeArray Subscripts);
|
||||
|
||||
/// Create debugging information entry for a vector type.
|
||||
@ -367,7 +368,7 @@ namespace llvm {
|
||||
/// \param AlignInBits Alignment.
|
||||
/// \param Ty Element type.
|
||||
/// \param Subscripts Subscripts.
|
||||
DICompositeType *createVectorType(uint64_t Size, uint64_t AlignInBits,
|
||||
DICompositeType *createVectorType(uint64_t Size, uint32_t AlignInBits,
|
||||
DIType *Ty, DINodeArray Subscripts);
|
||||
|
||||
/// Create debugging information entry for an
|
||||
@ -383,7 +384,7 @@ namespace llvm {
|
||||
/// \param UniqueIdentifier A unique identifier for the enum.
|
||||
DICompositeType *createEnumerationType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
|
||||
DIType *UnderlyingType, StringRef UniqueIdentifier = "");
|
||||
|
||||
/// Create subroutine type.
|
||||
@ -416,14 +417,14 @@ namespace llvm {
|
||||
DIScope *Scope, DIFile *F, unsigned Line,
|
||||
unsigned RuntimeLang = 0,
|
||||
uint64_t SizeInBits = 0,
|
||||
uint64_t AlignInBits = 0,
|
||||
uint32_t AlignInBits = 0,
|
||||
StringRef UniqueIdentifier = "");
|
||||
|
||||
/// Create a temporary forward-declared type.
|
||||
DICompositeType *createReplaceableCompositeType(
|
||||
unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
|
||||
unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
|
||||
uint64_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
|
||||
uint32_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
|
||||
StringRef UniqueIdentifier = "");
|
||||
|
||||
/// Retain DIScope* in a module even if it is not referenced
|
||||
|
@ -513,19 +513,19 @@ class DIType : public DIScope {
|
||||
unsigned Line;
|
||||
DIFlags Flags;
|
||||
uint64_t SizeInBits;
|
||||
uint64_t AlignInBits;
|
||||
uint64_t OffsetInBits;
|
||||
uint32_t AlignInBits;
|
||||
|
||||
protected:
|
||||
DIType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
|
||||
unsigned Line, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags, ArrayRef<Metadata *> Ops)
|
||||
: DIScope(C, ID, Storage, Tag, Ops) {
|
||||
init(Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
|
||||
}
|
||||
~DIType() = default;
|
||||
|
||||
void init(unsigned Line, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
void init(unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags) {
|
||||
this->Line = Line;
|
||||
this->Flags = Flags;
|
||||
@ -536,7 +536,7 @@ protected:
|
||||
|
||||
/// Change fields in place.
|
||||
void mutate(unsigned Tag, unsigned Line, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags) {
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags) {
|
||||
assert(isDistinct() && "Only distinct nodes can mutate");
|
||||
setTag(Tag);
|
||||
init(Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
|
||||
@ -614,7 +614,7 @@ class DIBasicType : public DIType {
|
||||
unsigned Encoding;
|
||||
|
||||
DIBasicType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding,
|
||||
ArrayRef<Metadata *> Ops)
|
||||
: DIType(C, DIBasicTypeKind, Storage, Tag, 0, SizeInBits, AlignInBits, 0,
|
||||
FlagZero, Ops),
|
||||
@ -623,14 +623,14 @@ class DIBasicType : public DIType {
|
||||
|
||||
static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||
StringRef Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding,
|
||||
uint32_t AlignInBits, unsigned Encoding,
|
||||
StorageType Storage, bool ShouldCreate = true) {
|
||||
return getImpl(Context, Tag, getCanonicalMDString(Context, Name),
|
||||
SizeInBits, AlignInBits, Encoding, Storage, ShouldCreate);
|
||||
}
|
||||
static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||
MDString *Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding,
|
||||
uint32_t AlignInBits, unsigned Encoding,
|
||||
StorageType Storage, bool ShouldCreate = true);
|
||||
|
||||
TempDIBasicType cloneImpl() const {
|
||||
@ -643,11 +643,11 @@ public:
|
||||
(Tag, Name, 0, 0, 0))
|
||||
DEFINE_MDNODE_GET(DIBasicType,
|
||||
(unsigned Tag, StringRef Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding),
|
||||
uint32_t AlignInBits, unsigned Encoding),
|
||||
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
||||
DEFINE_MDNODE_GET(DIBasicType,
|
||||
(unsigned Tag, MDString *Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding),
|
||||
uint32_t AlignInBits, unsigned Encoding),
|
||||
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
||||
|
||||
TempDIBasicType clone() const { return cloneImpl(); }
|
||||
@ -670,7 +670,7 @@ class DIDerivedType : public DIType {
|
||||
friend class MDNode;
|
||||
|
||||
DIDerivedType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||
unsigned Line, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags, ArrayRef<Metadata *> Ops)
|
||||
: DIType(C, DIDerivedTypeKind, Storage, Tag, Line, SizeInBits,
|
||||
AlignInBits, OffsetInBits, Flags, Ops) {}
|
||||
@ -679,7 +679,7 @@ class DIDerivedType : public DIType {
|
||||
static DIDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||
StringRef Name, DIFile *File, unsigned Line,
|
||||
DIScopeRef Scope, DITypeRef BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData, StorageType Storage,
|
||||
bool ShouldCreate = true) {
|
||||
@ -690,7 +690,7 @@ class DIDerivedType : public DIType {
|
||||
static DIDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||
MDString *Name, Metadata *File, unsigned Line,
|
||||
Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData, StorageType Storage,
|
||||
bool ShouldCreate = true);
|
||||
@ -706,7 +706,7 @@ public:
|
||||
DEFINE_MDNODE_GET(DIDerivedType,
|
||||
(unsigned Tag, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData = nullptr),
|
||||
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
||||
@ -714,8 +714,8 @@ public:
|
||||
DEFINE_MDNODE_GET(DIDerivedType,
|
||||
(unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
|
||||
DIScopeRef Scope, DITypeRef BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData = nullptr),
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, Metadata *ExtraData = nullptr),
|
||||
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
||||
AlignInBits, OffsetInBits, Flags, ExtraData))
|
||||
|
||||
@ -775,7 +775,7 @@ class DICompositeType : public DIType {
|
||||
|
||||
DICompositeType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||
unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
ArrayRef<Metadata *> Ops)
|
||||
: DIType(C, DICompositeTypeKind, Storage, Tag, Line, SizeInBits,
|
||||
AlignInBits, OffsetInBits, Flags, Ops),
|
||||
@ -784,8 +784,8 @@ class DICompositeType : public DIType {
|
||||
|
||||
/// Change fields in place.
|
||||
void mutate(unsigned Tag, unsigned Line, unsigned RuntimeLang,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags) {
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags) {
|
||||
assert(isDistinct() && "Only distinct nodes can mutate");
|
||||
assert(getRawIdentifier() && "Only ODR-uniqued nodes should mutate");
|
||||
this->RuntimeLang = RuntimeLang;
|
||||
@ -795,7 +795,7 @@ class DICompositeType : public DIType {
|
||||
static DICompositeType *
|
||||
getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
|
||||
unsigned Line, DIScopeRef Scope, DITypeRef BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, DINodeArray Elements, unsigned RuntimeLang,
|
||||
DITypeRef VTableHolder, DITemplateParameterArray TemplateParams,
|
||||
StringRef Identifier, StorageType Storage, bool ShouldCreate = true) {
|
||||
@ -808,7 +808,7 @@ class DICompositeType : public DIType {
|
||||
static DICompositeType *
|
||||
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
|
||||
Metadata *VTableHolder, Metadata *TemplateParams,
|
||||
MDString *Identifier, StorageType Storage, bool ShouldCreate = true);
|
||||
@ -825,8 +825,8 @@ public:
|
||||
DEFINE_MDNODE_GET(DICompositeType,
|
||||
(unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
|
||||
DIScopeRef Scope, DITypeRef BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
DINodeArray Elements, unsigned RuntimeLang,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, DINodeArray Elements, unsigned RuntimeLang,
|
||||
DITypeRef VTableHolder,
|
||||
DITemplateParameterArray TemplateParams = nullptr,
|
||||
StringRef Identifier = ""),
|
||||
@ -836,7 +836,7 @@ public:
|
||||
DEFINE_MDNODE_GET(DICompositeType,
|
||||
(unsigned Tag, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
|
||||
unsigned RuntimeLang, Metadata *VTableHolder,
|
||||
Metadata *TemplateParams = nullptr,
|
||||
@ -857,7 +857,7 @@ public:
|
||||
static DICompositeType *
|
||||
getODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag,
|
||||
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
|
||||
Metadata *BaseType, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
|
||||
unsigned RuntimeLang, Metadata *VTableHolder,
|
||||
Metadata *TemplateParams);
|
||||
@ -876,7 +876,7 @@ public:
|
||||
static DICompositeType *
|
||||
buildODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag,
|
||||
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
|
||||
Metadata *BaseType, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
|
||||
unsigned RuntimeLang, Metadata *VTableHolder,
|
||||
Metadata *TemplateParams);
|
||||
|
@ -3865,7 +3865,7 @@ bool LLParser::ParseDIBasicType(MDNode *&Result, bool IsDistinct) {
|
||||
OPTIONAL(tag, DwarfTagField, (dwarf::DW_TAG_base_type)); \
|
||||
OPTIONAL(name, MDStringField, ); \
|
||||
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
||||
OPTIONAL(encoding, DwarfAttEncodingField, );
|
||||
PARSE_MD_FIELDS();
|
||||
#undef VISIT_MD_FIELDS
|
||||
@ -3888,7 +3888,7 @@ bool LLParser::ParseDIDerivedType(MDNode *&Result, bool IsDistinct) {
|
||||
OPTIONAL(scope, MDField, ); \
|
||||
REQUIRED(baseType, MDField, ); \
|
||||
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
||||
OPTIONAL(offset, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(flags, DIFlagField, ); \
|
||||
OPTIONAL(extraData, MDField, );
|
||||
@ -3911,7 +3911,7 @@ bool LLParser::ParseDICompositeType(MDNode *&Result, bool IsDistinct) {
|
||||
OPTIONAL(scope, MDField, ); \
|
||||
OPTIONAL(baseType, MDField, ); \
|
||||
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
||||
OPTIONAL(offset, MDUnsignedField, (0, UINT64_MAX)); \
|
||||
OPTIONAL(flags, DIFlagField, ); \
|
||||
OPTIONAL(elements, MDField, ); \
|
||||
|
@ -2497,7 +2497,9 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
|
||||
Metadata *Scope = getDITypeRefOrNull(Record[5]);
|
||||
Metadata *BaseType = getDITypeRefOrNull(Record[6]);
|
||||
uint64_t SizeInBits = Record[7];
|
||||
uint64_t AlignInBits = Record[8];
|
||||
if (Record[8] > (uint64_t)std::numeric_limits<uint32_t>::max())
|
||||
return error("Alignment value is too large");
|
||||
uint32_t AlignInBits = Record[8];
|
||||
uint64_t OffsetInBits = Record[9];
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]);
|
||||
Metadata *Elements = getMDOrNull(Record[11]);
|
||||
|
@ -1404,8 +1404,9 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) {
|
||||
addUInt(MemberDie, dwarf::DW_AT_bit_size, None, Size);
|
||||
|
||||
uint64_t Offset = DT->getOffsetInBits();
|
||||
uint64_t Align = DT->getAlignInBits() ? DT->getAlignInBits() : FieldSize;
|
||||
uint64_t AlignMask = ~(Align - 1);
|
||||
uint32_t Align = DT->getAlignInBits() ? DT->getAlignInBits()
|
||||
: FieldSize;
|
||||
uint32_t AlignMask = ~(Align - 1);
|
||||
// The bits from the start of the storage unit to the start of the field.
|
||||
uint64_t StartBitOffset = Offset - (Offset & AlignMask);
|
||||
// The byte offset of the field's aligned storage unit inside the struct.
|
||||
|
@ -195,7 +195,7 @@ DIBasicType *DIBuilder::createNullPtrType() {
|
||||
}
|
||||
|
||||
DIBasicType *DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
unsigned Encoding) {
|
||||
assert(!Name.empty() && "Unable to create type without name");
|
||||
return DIBasicType::get(VMContext, dwarf::DW_TAG_base_type, Name, SizeInBits,
|
||||
@ -209,7 +209,7 @@ DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) {
|
||||
|
||||
DIDerivedType *DIBuilder::createPointerType(DIType *PointeeTy,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
StringRef Name) {
|
||||
// FIXME: Why is there a name here?
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_pointer_type, Name,
|
||||
@ -220,7 +220,7 @@ DIDerivedType *DIBuilder::createPointerType(DIType *PointeeTy,
|
||||
DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
|
||||
DIType *Base,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
DINode::DIFlags Flags) {
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_ptr_to_member_type, "",
|
||||
nullptr, 0, nullptr, PointeeTy, SizeInBits,
|
||||
@ -229,7 +229,7 @@ DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
|
||||
|
||||
DIDerivedType *DIBuilder::createReferenceType(unsigned Tag, DIType *RTy,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits) {
|
||||
uint32_t AlignInBits) {
|
||||
assert(RTy && "Unable to create reference type");
|
||||
return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, RTy,
|
||||
SizeInBits, AlignInBits, 0, DINode::FlagZero);
|
||||
@ -261,7 +261,7 @@ DIDerivedType *DIBuilder::createInheritance(DIType *Ty, DIType *BaseTy,
|
||||
DIDerivedType *DIBuilder::createMemberType(DIScope *Scope, StringRef Name,
|
||||
DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags, DIType *Ty) {
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
|
||||
@ -277,7 +277,7 @@ static ConstantAsMetadata *getConstantOrNull(Constant *C) {
|
||||
|
||||
DIDerivedType *DIBuilder::createBitFieldMemberType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty) {
|
||||
Flags |= DINode::FlagBitField;
|
||||
return DIDerivedType::get(
|
||||
@ -299,7 +299,7 @@ DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File,
|
||||
|
||||
DIDerivedType *
|
||||
DIBuilder::createObjCIVar(StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
uint64_t OffsetInBits, DINode::DIFlags Flags,
|
||||
DIType *Ty, MDNode *PropertyNode) {
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
|
||||
@ -357,7 +357,7 @@ DIBuilder::createTemplateParameterPack(DIScope *Context, StringRef Name,
|
||||
|
||||
DICompositeType *DIBuilder::createClassType(
|
||||
DIScope *Context, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
|
||||
DIType *VTableHolder, MDNode *TemplateParams, StringRef UniqueIdentifier) {
|
||||
assert((!Context || isa<DIScope>(Context)) &&
|
||||
@ -374,7 +374,7 @@ DICompositeType *DIBuilder::createClassType(
|
||||
|
||||
DICompositeType *DIBuilder::createStructType(
|
||||
DIScope *Context, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DINode::DIFlags Flags,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
|
||||
DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang,
|
||||
DIType *VTableHolder, StringRef UniqueIdentifier) {
|
||||
auto *R = DICompositeType::get(
|
||||
@ -387,7 +387,7 @@ DICompositeType *DIBuilder::createStructType(
|
||||
|
||||
DICompositeType *DIBuilder::createUnionType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DINode::DIFlags Flags,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
|
||||
DINodeArray Elements, unsigned RunTimeLang, StringRef UniqueIdentifier) {
|
||||
auto *R = DICompositeType::get(
|
||||
VMContext, dwarf::DW_TAG_union_type, Name, File, LineNumber,
|
||||
@ -413,7 +413,7 @@ DICompositeType *DIBuilder::createExternalTypeRef(unsigned Tag, DIFile *File,
|
||||
|
||||
DICompositeType *DIBuilder::createEnumerationType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
|
||||
DIType *UnderlyingType, StringRef UniqueIdentifier) {
|
||||
auto *CTy = DICompositeType::get(
|
||||
VMContext, dwarf::DW_TAG_enumeration_type, Name, File, LineNumber,
|
||||
@ -424,8 +424,8 @@ DICompositeType *DIBuilder::createEnumerationType(
|
||||
return CTy;
|
||||
}
|
||||
|
||||
DICompositeType *DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||
DIType *Ty,
|
||||
DICompositeType *DIBuilder::createArrayType(uint64_t Size,
|
||||
uint32_t AlignInBits, DIType *Ty,
|
||||
DINodeArray Subscripts) {
|
||||
auto *R = DICompositeType::get(VMContext, dwarf::DW_TAG_array_type, "",
|
||||
nullptr, 0, nullptr, Ty, Size, AlignInBits, 0,
|
||||
@ -435,7 +435,7 @@ DICompositeType *DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||
}
|
||||
|
||||
DICompositeType *DIBuilder::createVectorType(uint64_t Size,
|
||||
uint64_t AlignInBits, DIType *Ty,
|
||||
uint32_t AlignInBits, DIType *Ty,
|
||||
DINodeArray Subscripts) {
|
||||
auto *R = DICompositeType::get(VMContext, dwarf::DW_TAG_array_type, "",
|
||||
nullptr, 0, nullptr, Ty, Size, AlignInBits, 0,
|
||||
@ -479,7 +479,7 @@ DIBasicType *DIBuilder::createUnspecifiedParameter() { return nullptr; }
|
||||
DICompositeType *
|
||||
DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope,
|
||||
DIFile *F, unsigned Line, unsigned RuntimeLang,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
StringRef UniqueIdentifier) {
|
||||
// FIXME: Define in terms of createReplaceableForwardDecl() by calling
|
||||
// replaceWithUniqued().
|
||||
@ -493,7 +493,7 @@ DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope,
|
||||
|
||||
DICompositeType *DIBuilder::createReplaceableCompositeType(
|
||||
unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
|
||||
unsigned RuntimeLang, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
|
||||
DINode::DIFlags Flags, StringRef UniqueIdentifier) {
|
||||
auto *RetTy =
|
||||
DICompositeType::getTemporary(
|
||||
|
@ -227,7 +227,7 @@ DIEnumerator *DIEnumerator::getImpl(LLVMContext &Context, int64_t Value,
|
||||
|
||||
DIBasicType *DIBasicType::getImpl(LLVMContext &Context, unsigned Tag,
|
||||
MDString *Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding,
|
||||
uint32_t AlignInBits, unsigned Encoding,
|
||||
StorageType Storage, bool ShouldCreate) {
|
||||
assert(isCanonical(Name) && "Expected canonical MDString");
|
||||
DEFINE_GETIMPL_LOOKUP(DIBasicType,
|
||||
@ -240,7 +240,7 @@ DIBasicType *DIBasicType::getImpl(LLVMContext &Context, unsigned Tag,
|
||||
DIDerivedType *DIDerivedType::getImpl(
|
||||
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData, StorageType Storage, bool ShouldCreate) {
|
||||
assert(isCanonical(Name) && "Expected canonical MDString");
|
||||
DEFINE_GETIMPL_LOOKUP(DIDerivedType,
|
||||
@ -255,7 +255,7 @@ DIDerivedType *DIDerivedType::getImpl(
|
||||
DICompositeType *DICompositeType::getImpl(
|
||||
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
|
||||
Metadata *TemplateParams, MDString *Identifier, StorageType Storage,
|
||||
bool ShouldCreate) {
|
||||
@ -276,7 +276,7 @@ DICompositeType *DICompositeType::getImpl(
|
||||
DICompositeType *DICompositeType::buildODRType(
|
||||
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
|
||||
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
|
||||
Metadata *VTableHolder, Metadata *TemplateParams) {
|
||||
assert(!Identifier.getString().empty() && "Expected valid identifier");
|
||||
@ -310,7 +310,7 @@ DICompositeType *DICompositeType::buildODRType(
|
||||
DICompositeType *DICompositeType::getODRType(
|
||||
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
|
||||
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
|
||||
Metadata *VTableHolder, Metadata *TemplateParams) {
|
||||
assert(!Identifier.getString().empty() && "Expected valid identifier");
|
||||
|
@ -319,11 +319,11 @@ template <> struct MDNodeKeyImpl<DIBasicType> {
|
||||
unsigned Tag;
|
||||
MDString *Name;
|
||||
uint64_t SizeInBits;
|
||||
uint64_t AlignInBits;
|
||||
uint32_t AlignInBits;
|
||||
unsigned Encoding;
|
||||
|
||||
MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding)
|
||||
uint32_t AlignInBits, unsigned Encoding)
|
||||
: Tag(Tag), Name(Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||
Encoding(Encoding) {}
|
||||
MDNodeKeyImpl(const DIBasicType *N)
|
||||
@ -349,23 +349,23 @@ template <> struct MDNodeKeyImpl<DIDerivedType> {
|
||||
Metadata *Scope;
|
||||
Metadata *BaseType;
|
||||
uint64_t SizeInBits;
|
||||
uint64_t AlignInBits;
|
||||
uint64_t OffsetInBits;
|
||||
uint32_t AlignInBits;
|
||||
unsigned Flags;
|
||||
Metadata *ExtraData;
|
||||
|
||||
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
|
||||
Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||
Metadata *ExtraData)
|
||||
: Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
|
||||
BaseType(BaseType), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||
OffsetInBits(OffsetInBits), Flags(Flags), ExtraData(ExtraData) {}
|
||||
BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
|
||||
AlignInBits(AlignInBits), Flags(Flags), ExtraData(ExtraData) {}
|
||||
MDNodeKeyImpl(const DIDerivedType *N)
|
||||
: Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
|
||||
Line(N->getLine()), Scope(N->getRawScope()),
|
||||
BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
|
||||
AlignInBits(N->getAlignInBits()), OffsetInBits(N->getOffsetInBits()),
|
||||
OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
|
||||
Flags(N->getFlags()), ExtraData(N->getRawExtraData()) {}
|
||||
|
||||
bool isKeyOf(const DIDerivedType *RHS) const {
|
||||
@ -430,8 +430,8 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
|
||||
Metadata *Scope;
|
||||
Metadata *BaseType;
|
||||
uint64_t SizeInBits;
|
||||
uint64_t AlignInBits;
|
||||
uint64_t OffsetInBits;
|
||||
uint32_t AlignInBits;
|
||||
unsigned Flags;
|
||||
Metadata *Elements;
|
||||
unsigned RuntimeLang;
|
||||
@ -441,20 +441,20 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
|
||||
|
||||
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
|
||||
Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||
uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||
Metadata *Elements, unsigned RuntimeLang,
|
||||
Metadata *VTableHolder, Metadata *TemplateParams,
|
||||
MDString *Identifier)
|
||||
: Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
|
||||
BaseType(BaseType), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||
OffsetInBits(OffsetInBits), Flags(Flags), Elements(Elements),
|
||||
BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
|
||||
AlignInBits(AlignInBits), Flags(Flags), Elements(Elements),
|
||||
RuntimeLang(RuntimeLang), VTableHolder(VTableHolder),
|
||||
TemplateParams(TemplateParams), Identifier(Identifier) {}
|
||||
MDNodeKeyImpl(const DICompositeType *N)
|
||||
: Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
|
||||
Line(N->getLine()), Scope(N->getRawScope()),
|
||||
BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
|
||||
AlignInBits(N->getAlignInBits()), OffsetInBits(N->getOffsetInBits()),
|
||||
OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
|
||||
Flags(N->getFlags()), Elements(N->getRawElements()),
|
||||
RuntimeLang(N->getRuntimeLang()), VTableHolder(N->getRawVTableHolder()),
|
||||
TemplateParams(N->getRawTemplateParams()),
|
||||
|
@ -4,9 +4,9 @@
|
||||
; CHECK: !named = !{!0, !1, !2}
|
||||
!named = !{!0, !1, !2}
|
||||
|
||||
; CHECK: !0 = !DIBasicType(name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
|
||||
; CHECK-NEXT: !1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||
; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||
!0 = !DIBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
|
||||
!1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||
!2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||
; CHECK: !0 = !DIBasicType(name: "name", size: 18446744073709551615, align: 4294967294, encoding: DW_ATE_unsigned_char)
|
||||
; CHECK-NEXT: !1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 4294967294, offset: 18446744073709551613)
|
||||
; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 4294967294, offset: 18446744073709551613)
|
||||
!0 = !DIBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 4294967294, encoding: DW_ATE_unsigned_char)
|
||||
!1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 4294967294, offset: 18446744073709551613)
|
||||
!2 = !DICompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 4294967294, offset: 18446744073709551613)
|
||||
|
@ -997,9 +997,9 @@ TEST_F(DIBasicTypeTest, get) {
|
||||
|
||||
TEST_F(DIBasicTypeTest, getWithLargeValues) {
|
||||
auto *N = DIBasicType::get(Context, dwarf::DW_TAG_base_type, "special",
|
||||
UINT64_MAX, UINT64_MAX - 1, 7);
|
||||
UINT64_MAX, UINT32_MAX - 1, 7);
|
||||
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
|
||||
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
|
||||
EXPECT_EQ(UINT32_MAX - 1, N->getAlignInBits());
|
||||
}
|
||||
|
||||
TEST_F(DIBasicTypeTest, getUnspecified) {
|
||||
@ -1121,9 +1121,9 @@ TEST_F(DIDerivedTypeTest, getWithLargeValues) {
|
||||
|
||||
auto *N = DIDerivedType::get(
|
||||
Context, dwarf::DW_TAG_pointer_type, "something", File, 1, Scope,
|
||||
BaseType, UINT64_MAX, UINT64_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
|
||||
BaseType, UINT64_MAX, UINT32_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
|
||||
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
|
||||
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
|
||||
EXPECT_EQ(UINT32_MAX - 1, N->getAlignInBits());
|
||||
EXPECT_EQ(UINT64_MAX - 2, N->getOffsetInBits());
|
||||
}
|
||||
|
||||
@ -1137,7 +1137,7 @@ TEST_F(DICompositeTypeTest, get) {
|
||||
DIScope *Scope = getSubprogram();
|
||||
DIType *BaseType = getCompositeType();
|
||||
uint64_t SizeInBits = 2;
|
||||
uint64_t AlignInBits = 3;
|
||||
uint32_t AlignInBits = 3;
|
||||
uint64_t OffsetInBits = 4;
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
|
||||
MDTuple *Elements = getTuple();
|
||||
@ -1257,7 +1257,7 @@ TEST_F(DICompositeTypeTest, getWithLargeValues) {
|
||||
DIScope *Scope = getSubprogram();
|
||||
DIType *BaseType = getCompositeType();
|
||||
uint64_t SizeInBits = UINT64_MAX;
|
||||
uint64_t AlignInBits = UINT64_MAX - 1;
|
||||
uint32_t AlignInBits = UINT32_MAX - 1;
|
||||
uint64_t OffsetInBits = UINT64_MAX - 2;
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
|
||||
MDTuple *Elements = getTuple();
|
||||
@ -1283,7 +1283,7 @@ TEST_F(DICompositeTypeTest, replaceOperands) {
|
||||
DIScope *Scope = getSubprogram();
|
||||
DIType *BaseType = getCompositeType();
|
||||
uint64_t SizeInBits = 2;
|
||||
uint64_t AlignInBits = 3;
|
||||
uint32_t AlignInBits = 3;
|
||||
uint64_t OffsetInBits = 4;
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
|
||||
unsigned RuntimeLang = 6;
|
||||
|
Loading…
Reference in New Issue
Block a user