mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
IR: Fix MDType fields from unsigned to uint64_t
When trying to match the current schema with the new debug info hierarchy, I downgraded `SizeInBits`, `AlignInBits` and `OffsetInBits` to 32-bits (oops!). Caught this while testing my upgrade script to move the hierarchy into place. Bump it back up to 64-bits and update tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5898fc70ec
commit
8a76ab6eaa
@ -358,24 +358,25 @@ public:
|
|||||||
/// TODO: Split up flags.
|
/// TODO: Split up flags.
|
||||||
class MDType : public MDScope {
|
class MDType : public MDScope {
|
||||||
unsigned Line;
|
unsigned Line;
|
||||||
unsigned SizeInBits;
|
|
||||||
unsigned AlignInBits;
|
|
||||||
unsigned OffsetInBits;
|
|
||||||
unsigned Flags;
|
unsigned Flags;
|
||||||
|
uint64_t SizeInBits;
|
||||||
|
uint64_t AlignInBits;
|
||||||
|
uint64_t OffsetInBits;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MDType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
|
MDType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
|
||||||
unsigned Line, unsigned SizeInBits, unsigned AlignInBits,
|
unsigned Line, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags, ArrayRef<Metadata *> Ops)
|
uint64_t OffsetInBits, unsigned Flags, ArrayRef<Metadata *> Ops)
|
||||||
: MDScope(C, ID, Storage, Tag, Ops), Line(Line), SizeInBits(SizeInBits),
|
: MDScope(C, ID, Storage, Tag, Ops), Line(Line), Flags(Flags),
|
||||||
AlignInBits(AlignInBits), OffsetInBits(OffsetInBits), Flags(Flags) {}
|
SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||||
|
OffsetInBits(OffsetInBits) {}
|
||||||
~MDType() {}
|
~MDType() {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unsigned getLine() const { return Line; }
|
unsigned getLine() const { return Line; }
|
||||||
unsigned getSizeInBits() const { return SizeInBits; }
|
uint64_t getSizeInBits() const { return SizeInBits; }
|
||||||
unsigned getAlignInBits() const { return AlignInBits; }
|
uint64_t getAlignInBits() const { return AlignInBits; }
|
||||||
unsigned getOffsetInBits() const { return OffsetInBits; }
|
uint64_t getOffsetInBits() const { return OffsetInBits; }
|
||||||
unsigned getFlags() const { return Flags; }
|
unsigned getFlags() const { return Flags; }
|
||||||
|
|
||||||
Metadata *getScope() const { return getOperand(1); }
|
Metadata *getScope() const { return getOperand(1); }
|
||||||
@ -407,7 +408,7 @@ class MDBasicType : public MDType {
|
|||||||
unsigned Encoding;
|
unsigned Encoding;
|
||||||
|
|
||||||
MDBasicType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
MDBasicType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||||
unsigned SizeInBits, unsigned AlignInBits, unsigned Encoding,
|
uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding,
|
||||||
ArrayRef<Metadata *> Ops)
|
ArrayRef<Metadata *> Ops)
|
||||||
: MDType(C, MDBasicTypeKind, Storage, Tag, 0, SizeInBits, AlignInBits, 0,
|
: MDType(C, MDBasicTypeKind, Storage, Tag, 0, SizeInBits, AlignInBits, 0,
|
||||||
0, Ops),
|
0, Ops),
|
||||||
@ -415,15 +416,15 @@ class MDBasicType : public MDType {
|
|||||||
~MDBasicType() {}
|
~MDBasicType() {}
|
||||||
|
|
||||||
static MDBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
static MDBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||||
StringRef Name, unsigned SizeInBits,
|
StringRef Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding,
|
uint64_t AlignInBits, unsigned Encoding,
|
||||||
StorageType Storage, bool ShouldCreate = true) {
|
StorageType Storage, bool ShouldCreate = true) {
|
||||||
return getImpl(Context, Tag, getCanonicalMDString(Context, Name),
|
return getImpl(Context, Tag, getCanonicalMDString(Context, Name),
|
||||||
SizeInBits, AlignInBits, Encoding, Storage, ShouldCreate);
|
SizeInBits, AlignInBits, Encoding, Storage, ShouldCreate);
|
||||||
}
|
}
|
||||||
static MDBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
static MDBasicType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||||
MDString *Name, unsigned SizeInBits,
|
MDString *Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding,
|
uint64_t AlignInBits, unsigned Encoding,
|
||||||
StorageType Storage, bool ShouldCreate = true);
|
StorageType Storage, bool ShouldCreate = true);
|
||||||
|
|
||||||
TempMDBasicType cloneImpl() const {
|
TempMDBasicType cloneImpl() const {
|
||||||
@ -433,12 +434,12 @@ class MDBasicType : public MDType {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_MDNODE_GET(MDBasicType,
|
DEFINE_MDNODE_GET(MDBasicType,
|
||||||
(unsigned Tag, StringRef Name, unsigned SizeInBits,
|
(unsigned Tag, StringRef Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding),
|
uint64_t AlignInBits, unsigned Encoding),
|
||||||
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
||||||
DEFINE_MDNODE_GET(MDBasicType,
|
DEFINE_MDNODE_GET(MDBasicType,
|
||||||
(unsigned Tag, MDString *Name, unsigned SizeInBits,
|
(unsigned Tag, MDString *Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding),
|
uint64_t AlignInBits, unsigned Encoding),
|
||||||
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
(Tag, Name, SizeInBits, AlignInBits, Encoding))
|
||||||
|
|
||||||
TempMDBasicType clone() const { return cloneImpl(); }
|
TempMDBasicType clone() const { return cloneImpl(); }
|
||||||
@ -456,8 +457,8 @@ public:
|
|||||||
class MDDerivedTypeBase : public MDType {
|
class MDDerivedTypeBase : public MDType {
|
||||||
protected:
|
protected:
|
||||||
MDDerivedTypeBase(LLVMContext &C, unsigned ID, StorageType Storage,
|
MDDerivedTypeBase(LLVMContext &C, unsigned ID, StorageType Storage,
|
||||||
unsigned Tag, unsigned Line, unsigned SizeInBits,
|
unsigned Tag, unsigned Line, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
ArrayRef<Metadata *> Ops)
|
ArrayRef<Metadata *> Ops)
|
||||||
: MDType(C, ID, Storage, Tag, Line, SizeInBits, AlignInBits, OffsetInBits,
|
: MDType(C, ID, Storage, Tag, Line, SizeInBits, AlignInBits, OffsetInBits,
|
||||||
Flags, Ops) {}
|
Flags, Ops) {}
|
||||||
@ -484,8 +485,8 @@ class MDDerivedType : public MDDerivedTypeBase {
|
|||||||
friend class MDNode;
|
friend class MDNode;
|
||||||
|
|
||||||
MDDerivedType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
MDDerivedType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||||
unsigned Line, unsigned SizeInBits, unsigned AlignInBits,
|
unsigned Line, uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags, ArrayRef<Metadata *> Ops)
|
uint64_t OffsetInBits, unsigned Flags, ArrayRef<Metadata *> Ops)
|
||||||
: MDDerivedTypeBase(C, MDDerivedTypeKind, Storage, Tag, Line, SizeInBits,
|
: MDDerivedTypeBase(C, MDDerivedTypeKind, Storage, Tag, Line, SizeInBits,
|
||||||
AlignInBits, OffsetInBits, Flags, Ops) {}
|
AlignInBits, OffsetInBits, Flags, Ops) {}
|
||||||
~MDDerivedType() {}
|
~MDDerivedType() {}
|
||||||
@ -493,8 +494,8 @@ class MDDerivedType : public MDDerivedTypeBase {
|
|||||||
static MDDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
static MDDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||||
StringRef Name, Metadata *File, unsigned Line,
|
StringRef Name, Metadata *File, unsigned Line,
|
||||||
Metadata *Scope, Metadata *BaseType,
|
Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData, StorageType Storage,
|
Metadata *ExtraData, StorageType Storage,
|
||||||
bool ShouldCreate = true) {
|
bool ShouldCreate = true) {
|
||||||
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
|
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
|
||||||
@ -504,8 +505,8 @@ class MDDerivedType : public MDDerivedTypeBase {
|
|||||||
static MDDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
static MDDerivedType *getImpl(LLVMContext &Context, unsigned Tag,
|
||||||
MDString *Name, Metadata *File, unsigned Line,
|
MDString *Name, Metadata *File, unsigned Line,
|
||||||
Metadata *Scope, Metadata *BaseType,
|
Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData, StorageType Storage,
|
Metadata *ExtraData, StorageType Storage,
|
||||||
bool ShouldCreate = true);
|
bool ShouldCreate = true);
|
||||||
|
|
||||||
@ -520,16 +521,16 @@ public:
|
|||||||
DEFINE_MDNODE_GET(MDDerivedType,
|
DEFINE_MDNODE_GET(MDDerivedType,
|
||||||
(unsigned Tag, MDString *Name, Metadata *File,
|
(unsigned Tag, MDString *Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData = nullptr),
|
Metadata *ExtraData = nullptr),
|
||||||
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
||||||
AlignInBits, OffsetInBits, Flags, ExtraData))
|
AlignInBits, OffsetInBits, Flags, ExtraData))
|
||||||
DEFINE_MDNODE_GET(MDDerivedType,
|
DEFINE_MDNODE_GET(MDDerivedType,
|
||||||
(unsigned Tag, StringRef Name, Metadata *File,
|
(unsigned Tag, StringRef Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData = nullptr),
|
Metadata *ExtraData = nullptr),
|
||||||
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
||||||
AlignInBits, OffsetInBits, Flags, ExtraData))
|
AlignInBits, OffsetInBits, Flags, ExtraData))
|
||||||
@ -559,8 +560,8 @@ class MDCompositeTypeBase : public MDDerivedTypeBase {
|
|||||||
protected:
|
protected:
|
||||||
MDCompositeTypeBase(LLVMContext &C, unsigned ID, StorageType Storage,
|
MDCompositeTypeBase(LLVMContext &C, unsigned ID, StorageType Storage,
|
||||||
unsigned Tag, unsigned Line, unsigned RuntimeLang,
|
unsigned Tag, unsigned Line, unsigned RuntimeLang,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
ArrayRef<Metadata *> Ops)
|
ArrayRef<Metadata *> Ops)
|
||||||
: MDDerivedTypeBase(C, ID, Storage, Tag, Line, SizeInBits, AlignInBits,
|
: MDDerivedTypeBase(C, ID, Storage, Tag, Line, SizeInBits, AlignInBits,
|
||||||
OffsetInBits, Flags, Ops),
|
OffsetInBits, Flags, Ops),
|
||||||
@ -614,8 +615,8 @@ class MDCompositeType : public MDCompositeTypeBase {
|
|||||||
friend class MDNode;
|
friend class MDNode;
|
||||||
|
|
||||||
MDCompositeType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
MDCompositeType(LLVMContext &C, StorageType Storage, unsigned Tag,
|
||||||
unsigned Line, unsigned RuntimeLang, unsigned SizeInBits,
|
unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
ArrayRef<Metadata *> Ops)
|
ArrayRef<Metadata *> Ops)
|
||||||
: MDCompositeTypeBase(C, MDCompositeTypeKind, Storage, Tag, Line,
|
: MDCompositeTypeBase(C, MDCompositeTypeKind, Storage, Tag, Line,
|
||||||
RuntimeLang, SizeInBits, AlignInBits, OffsetInBits,
|
RuntimeLang, SizeInBits, AlignInBits, OffsetInBits,
|
||||||
@ -625,8 +626,8 @@ class MDCompositeType : public MDCompositeTypeBase {
|
|||||||
static MDCompositeType *
|
static MDCompositeType *
|
||||||
getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
|
getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits, unsigned OffsetInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||||
unsigned Flags, Metadata *Elements, unsigned RuntimeLang,
|
uint64_t Flags, Metadata *Elements, unsigned RuntimeLang,
|
||||||
Metadata *VTableHolder, Metadata *TemplateParams,
|
Metadata *VTableHolder, Metadata *TemplateParams,
|
||||||
StringRef Identifier, StorageType Storage, bool ShouldCreate = true) {
|
StringRef Identifier, StorageType Storage, bool ShouldCreate = true) {
|
||||||
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
|
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
|
||||||
@ -638,7 +639,7 @@ class MDCompositeType : public MDCompositeTypeBase {
|
|||||||
static MDCompositeType *
|
static MDCompositeType *
|
||||||
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits, unsigned OffsetInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||||
unsigned Flags, Metadata *Elements, unsigned RuntimeLang,
|
unsigned Flags, Metadata *Elements, unsigned RuntimeLang,
|
||||||
Metadata *VTableHolder, Metadata *TemplateParams,
|
Metadata *VTableHolder, Metadata *TemplateParams,
|
||||||
MDString *Identifier, StorageType Storage, bool ShouldCreate = true);
|
MDString *Identifier, StorageType Storage, bool ShouldCreate = true);
|
||||||
@ -655,8 +656,8 @@ public:
|
|||||||
DEFINE_MDNODE_GET(MDCompositeType,
|
DEFINE_MDNODE_GET(MDCompositeType,
|
||||||
(unsigned Tag, StringRef Name, Metadata *File,
|
(unsigned Tag, StringRef Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags, Metadata *Elements,
|
uint64_t OffsetInBits, unsigned Flags, Metadata *Elements,
|
||||||
unsigned RuntimeLang, Metadata *VTableHolder,
|
unsigned RuntimeLang, Metadata *VTableHolder,
|
||||||
Metadata *TemplateParams = nullptr,
|
Metadata *TemplateParams = nullptr,
|
||||||
StringRef Identifier = ""),
|
StringRef Identifier = ""),
|
||||||
@ -666,8 +667,8 @@ public:
|
|||||||
DEFINE_MDNODE_GET(MDCompositeType,
|
DEFINE_MDNODE_GET(MDCompositeType,
|
||||||
(unsigned Tag, MDString *Name, Metadata *File,
|
(unsigned Tag, MDString *Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
unsigned Line, Metadata *Scope, Metadata *BaseType,
|
||||||
unsigned SizeInBits, unsigned AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned OffsetInBits, unsigned Flags, Metadata *Elements,
|
uint64_t OffsetInBits, unsigned Flags, Metadata *Elements,
|
||||||
unsigned RuntimeLang, Metadata *VTableHolder,
|
unsigned RuntimeLang, Metadata *VTableHolder,
|
||||||
Metadata *TemplateParams = nullptr,
|
Metadata *TemplateParams = nullptr,
|
||||||
MDString *Identifier = nullptr),
|
MDString *Identifier = nullptr),
|
||||||
|
@ -3304,8 +3304,8 @@ bool LLParser::ParseMDBasicType(MDNode *&Result, bool IsDistinct) {
|
|||||||
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
|
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
|
||||||
REQUIRED(tag, DwarfTagField, ); \
|
REQUIRED(tag, DwarfTagField, ); \
|
||||||
OPTIONAL(name, MDStringField, ); \
|
OPTIONAL(name, MDStringField, ); \
|
||||||
OPTIONAL(size, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(encoding, DwarfAttEncodingField, );
|
OPTIONAL(encoding, DwarfAttEncodingField, );
|
||||||
PARSE_MD_FIELDS();
|
PARSE_MD_FIELDS();
|
||||||
#undef VISIT_MD_FIELDS
|
#undef VISIT_MD_FIELDS
|
||||||
@ -3327,9 +3327,9 @@ bool LLParser::ParseMDDerivedType(MDNode *&Result, bool IsDistinct) {
|
|||||||
OPTIONAL(line, LineField, ); \
|
OPTIONAL(line, LineField, ); \
|
||||||
OPTIONAL(scope, MDField, ); \
|
OPTIONAL(scope, MDField, ); \
|
||||||
REQUIRED(baseType, MDField, ); \
|
REQUIRED(baseType, MDField, ); \
|
||||||
OPTIONAL(size, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(offset, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(offset, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(flags, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(flags, MDUnsignedField, (0, UINT32_MAX)); \
|
||||||
OPTIONAL(extraData, MDField, );
|
OPTIONAL(extraData, MDField, );
|
||||||
PARSE_MD_FIELDS();
|
PARSE_MD_FIELDS();
|
||||||
@ -3350,9 +3350,9 @@ bool LLParser::ParseMDCompositeType(MDNode *&Result, bool IsDistinct) {
|
|||||||
OPTIONAL(line, LineField, ); \
|
OPTIONAL(line, LineField, ); \
|
||||||
OPTIONAL(scope, MDField, ); \
|
OPTIONAL(scope, MDField, ); \
|
||||||
OPTIONAL(baseType, MDField, ); \
|
OPTIONAL(baseType, MDField, ); \
|
||||||
OPTIONAL(size, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(size, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(align, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(offset, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(offset, MDUnsignedField, (0, UINT64_MAX)); \
|
||||||
OPTIONAL(flags, MDUnsignedField, (0, UINT32_MAX)); \
|
OPTIONAL(flags, MDUnsignedField, (0, UINT32_MAX)); \
|
||||||
OPTIONAL(elements, MDField, ); \
|
OPTIONAL(elements, MDField, ); \
|
||||||
OPTIONAL(runtimeLang, DwarfLangField, ); \
|
OPTIONAL(runtimeLang, DwarfLangField, ); \
|
||||||
|
@ -148,8 +148,8 @@ MDEnumerator *MDEnumerator::getImpl(LLVMContext &Context, int64_t Value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MDBasicType *MDBasicType::getImpl(LLVMContext &Context, unsigned Tag,
|
MDBasicType *MDBasicType::getImpl(LLVMContext &Context, unsigned Tag,
|
||||||
MDString *Name, unsigned SizeInBits,
|
MDString *Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding,
|
uint64_t AlignInBits, unsigned Encoding,
|
||||||
StorageType Storage, bool ShouldCreate) {
|
StorageType Storage, bool ShouldCreate) {
|
||||||
assert(isCanonical(Name) && "Expected canonical MDString");
|
assert(isCanonical(Name) && "Expected canonical MDString");
|
||||||
DEFINE_GETIMPL_LOOKUP(
|
DEFINE_GETIMPL_LOOKUP(
|
||||||
@ -161,8 +161,8 @@ MDBasicType *MDBasicType::getImpl(LLVMContext &Context, unsigned Tag,
|
|||||||
|
|
||||||
MDDerivedType *MDDerivedType::getImpl(
|
MDDerivedType *MDDerivedType::getImpl(
|
||||||
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType, unsigned SizeInBits,
|
unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData, StorageType Storage, bool ShouldCreate) {
|
Metadata *ExtraData, StorageType Storage, bool ShouldCreate) {
|
||||||
assert(isCanonical(Name) && "Expected canonical MDString");
|
assert(isCanonical(Name) && "Expected canonical MDString");
|
||||||
DEFINE_GETIMPL_LOOKUP(MDDerivedType, (Tag, getString(Name), File, Line, Scope,
|
DEFINE_GETIMPL_LOOKUP(MDDerivedType, (Tag, getString(Name), File, Line, Scope,
|
||||||
@ -176,8 +176,8 @@ MDDerivedType *MDDerivedType::getImpl(
|
|||||||
|
|
||||||
MDCompositeType *MDCompositeType::getImpl(
|
MDCompositeType *MDCompositeType::getImpl(
|
||||||
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
|
||||||
unsigned Line, Metadata *Scope, Metadata *BaseType, unsigned SizeInBits,
|
unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
|
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
|
||||||
Metadata *TemplateParams, MDString *Identifier, StorageType Storage,
|
Metadata *TemplateParams, MDString *Identifier, StorageType Storage,
|
||||||
bool ShouldCreate) {
|
bool ShouldCreate) {
|
||||||
|
@ -303,12 +303,12 @@ template <> struct MDNodeKeyImpl<MDEnumerator> {
|
|||||||
template <> struct MDNodeKeyImpl<MDBasicType> {
|
template <> struct MDNodeKeyImpl<MDBasicType> {
|
||||||
unsigned Tag;
|
unsigned Tag;
|
||||||
StringRef Name;
|
StringRef Name;
|
||||||
unsigned SizeInBits;
|
uint64_t SizeInBits;
|
||||||
unsigned AlignInBits;
|
uint64_t AlignInBits;
|
||||||
unsigned Encoding;
|
unsigned Encoding;
|
||||||
|
|
||||||
MDNodeKeyImpl(unsigned Tag, StringRef Name, unsigned SizeInBits,
|
MDNodeKeyImpl(unsigned Tag, StringRef Name, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned Encoding)
|
uint64_t AlignInBits, unsigned Encoding)
|
||||||
: Tag(Tag), Name(Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
: Tag(Tag), Name(Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||||
Encoding(Encoding) {}
|
Encoding(Encoding) {}
|
||||||
MDNodeKeyImpl(const MDBasicType *N)
|
MDNodeKeyImpl(const MDBasicType *N)
|
||||||
@ -333,15 +333,15 @@ template <> struct MDNodeKeyImpl<MDDerivedType> {
|
|||||||
unsigned Line;
|
unsigned Line;
|
||||||
Metadata *Scope;
|
Metadata *Scope;
|
||||||
Metadata *BaseType;
|
Metadata *BaseType;
|
||||||
unsigned SizeInBits;
|
uint64_t SizeInBits;
|
||||||
unsigned AlignInBits;
|
uint64_t AlignInBits;
|
||||||
unsigned OffsetInBits;
|
uint64_t OffsetInBits;
|
||||||
unsigned Flags;
|
unsigned Flags;
|
||||||
Metadata *ExtraData;
|
Metadata *ExtraData;
|
||||||
|
|
||||||
MDNodeKeyImpl(unsigned Tag, StringRef Name, Metadata *File, unsigned Line,
|
MDNodeKeyImpl(unsigned Tag, StringRef Name, Metadata *File, unsigned Line,
|
||||||
Metadata *Scope, Metadata *BaseType, unsigned SizeInBits,
|
Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *ExtraData)
|
Metadata *ExtraData)
|
||||||
: Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
|
: Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
|
||||||
BaseType(BaseType), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
BaseType(BaseType), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
|
||||||
@ -375,9 +375,9 @@ template <> struct MDNodeKeyImpl<MDCompositeType> {
|
|||||||
unsigned Line;
|
unsigned Line;
|
||||||
Metadata *Scope;
|
Metadata *Scope;
|
||||||
Metadata *BaseType;
|
Metadata *BaseType;
|
||||||
unsigned SizeInBits;
|
uint64_t SizeInBits;
|
||||||
unsigned AlignInBits;
|
uint64_t AlignInBits;
|
||||||
unsigned OffsetInBits;
|
uint64_t OffsetInBits;
|
||||||
unsigned Flags;
|
unsigned Flags;
|
||||||
Metadata *Elements;
|
Metadata *Elements;
|
||||||
unsigned RuntimeLang;
|
unsigned RuntimeLang;
|
||||||
@ -386,8 +386,8 @@ template <> struct MDNodeKeyImpl<MDCompositeType> {
|
|||||||
StringRef Identifier;
|
StringRef Identifier;
|
||||||
|
|
||||||
MDNodeKeyImpl(unsigned Tag, StringRef Name, Metadata *File, unsigned Line,
|
MDNodeKeyImpl(unsigned Tag, StringRef Name, Metadata *File, unsigned Line,
|
||||||
Metadata *Scope, Metadata *BaseType, unsigned SizeInBits,
|
Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
|
||||||
unsigned AlignInBits, unsigned OffsetInBits, unsigned Flags,
|
uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
|
||||||
Metadata *Elements, unsigned RuntimeLang,
|
Metadata *Elements, unsigned RuntimeLang,
|
||||||
Metadata *VTableHolder, Metadata *TemplateParams,
|
Metadata *VTableHolder, Metadata *TemplateParams,
|
||||||
StringRef Identifier)
|
StringRef Identifier)
|
||||||
|
12
test/Assembler/mdtype-large-values.ll
Normal file
12
test/Assembler/mdtype-large-values.ll
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
|
||||||
|
; RUN: verify-uselistorder %s
|
||||||
|
|
||||||
|
; CHECK: !named = !{!0, !1, !2}
|
||||||
|
!named = !{!0, !1, !2}
|
||||||
|
|
||||||
|
; CHECK: !0 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
|
||||||
|
; CHECK-NEXT: !1 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||||
|
; CHECK-NEXT: !2 = !MDCompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||||
|
!0 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char)
|
||||||
|
!1 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
||||||
|
!2 = !MDCompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613)
|
@ -723,6 +723,13 @@ TEST_F(MDBasicTypeTest, get) {
|
|||||||
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MDBasicTypeTest, getWithLargeValues) {
|
||||||
|
auto *N = MDBasicType::get(Context, dwarf::DW_TAG_base_type, "special",
|
||||||
|
UINT64_MAX, UINT64_MAX - 1, 7);
|
||||||
|
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
|
||||||
|
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
|
||||||
|
}
|
||||||
|
|
||||||
typedef MetadataTest MDDerivedTypeTest;
|
typedef MetadataTest MDDerivedTypeTest;
|
||||||
|
|
||||||
TEST_F(MDDerivedTypeTest, get) {
|
TEST_F(MDDerivedTypeTest, get) {
|
||||||
@ -786,6 +793,20 @@ TEST_F(MDDerivedTypeTest, get) {
|
|||||||
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MDDerivedTypeTest, getWithLargeValues) {
|
||||||
|
Metadata *File = MDTuple::getDistinct(Context, None);
|
||||||
|
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
||||||
|
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
||||||
|
Metadata *ExtraData = MDTuple::getDistinct(Context, None);
|
||||||
|
|
||||||
|
auto *N = MDDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
|
||||||
|
File, 1, Scope, BaseType, UINT64_MAX,
|
||||||
|
UINT64_MAX - 1, UINT64_MAX - 2, 5, ExtraData);
|
||||||
|
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
|
||||||
|
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
|
||||||
|
EXPECT_EQ(UINT64_MAX - 2, N->getOffsetInBits());
|
||||||
|
}
|
||||||
|
|
||||||
typedef MetadataTest MDCompositeTypeTest;
|
typedef MetadataTest MDCompositeTypeTest;
|
||||||
|
|
||||||
TEST_F(MDCompositeTypeTest, get) {
|
TEST_F(MDCompositeTypeTest, get) {
|
||||||
@ -795,9 +816,9 @@ TEST_F(MDCompositeTypeTest, get) {
|
|||||||
unsigned Line = 1;
|
unsigned Line = 1;
|
||||||
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
||||||
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
||||||
unsigned SizeInBits = 2;
|
uint64_t SizeInBits = 2;
|
||||||
unsigned AlignInBits = 3;
|
uint64_t AlignInBits = 3;
|
||||||
unsigned OffsetInBits = 4;
|
uint64_t OffsetInBits = 4;
|
||||||
unsigned Flags = 5;
|
unsigned Flags = 5;
|
||||||
Metadata *Elements = MDTuple::getDistinct(Context, None);
|
Metadata *Elements = MDTuple::getDistinct(Context, None);
|
||||||
unsigned RuntimeLang = 6;
|
unsigned RuntimeLang = 6;
|
||||||
@ -905,6 +926,32 @@ TEST_F(MDCompositeTypeTest, get) {
|
|||||||
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MDCompositeTypeTest, getWithLargeValues) {
|
||||||
|
unsigned Tag = dwarf::DW_TAG_structure_type;
|
||||||
|
StringRef Name = "some name";
|
||||||
|
Metadata *File = MDTuple::getDistinct(Context, None);
|
||||||
|
unsigned Line = 1;
|
||||||
|
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
||||||
|
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
||||||
|
uint64_t SizeInBits = UINT64_MAX;
|
||||||
|
uint64_t AlignInBits = UINT64_MAX - 1;
|
||||||
|
uint64_t OffsetInBits = UINT64_MAX - 2;
|
||||||
|
unsigned Flags = 5;
|
||||||
|
Metadata *Elements = MDTuple::getDistinct(Context, None);
|
||||||
|
unsigned RuntimeLang = 6;
|
||||||
|
Metadata *VTableHolder = MDTuple::getDistinct(Context, None);
|
||||||
|
Metadata *TemplateParams = MDTuple::getDistinct(Context, None);
|
||||||
|
StringRef Identifier = "some id";
|
||||||
|
|
||||||
|
auto *N = MDCompositeType::get(Context, Tag, Name, File, Line, Scope,
|
||||||
|
BaseType, SizeInBits, AlignInBits,
|
||||||
|
OffsetInBits, Flags, Elements, RuntimeLang,
|
||||||
|
VTableHolder, TemplateParams, Identifier);
|
||||||
|
EXPECT_EQ(SizeInBits, N->getSizeInBits());
|
||||||
|
EXPECT_EQ(AlignInBits, N->getAlignInBits());
|
||||||
|
EXPECT_EQ(OffsetInBits, N->getOffsetInBits());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MDCompositeTypeTest, replaceOperands) {
|
TEST_F(MDCompositeTypeTest, replaceOperands) {
|
||||||
unsigned Tag = dwarf::DW_TAG_structure_type;
|
unsigned Tag = dwarf::DW_TAG_structure_type;
|
||||||
StringRef Name = "some name";
|
StringRef Name = "some name";
|
||||||
@ -912,9 +959,9 @@ TEST_F(MDCompositeTypeTest, replaceOperands) {
|
|||||||
unsigned Line = 1;
|
unsigned Line = 1;
|
||||||
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
Metadata *Scope = MDTuple::getDistinct(Context, None);
|
||||||
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
Metadata *BaseType = MDTuple::getDistinct(Context, None);
|
||||||
unsigned SizeInBits = 2;
|
uint64_t SizeInBits = 2;
|
||||||
unsigned AlignInBits = 3;
|
uint64_t AlignInBits = 3;
|
||||||
unsigned OffsetInBits = 4;
|
uint64_t OffsetInBits = 4;
|
||||||
unsigned Flags = 5;
|
unsigned Flags = 5;
|
||||||
unsigned RuntimeLang = 6;
|
unsigned RuntimeLang = 6;
|
||||||
StringRef Identifier = "some id";
|
StringRef Identifier = "some id";
|
||||||
|
Loading…
Reference in New Issue
Block a user