mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
[TableGen] Reorder fields in Record class to optimize memory usage. NFC
llvm-svn: 258064
This commit is contained in:
parent
22fa1c4ac6
commit
c7ba465dbf
@ -1151,8 +1151,6 @@ inline raw_ostream &operator<<(raw_ostream &OS, const RecordVal &RV) {
|
|||||||
class Record {
|
class Record {
|
||||||
static unsigned LastID;
|
static unsigned LastID;
|
||||||
|
|
||||||
// Unique record ID.
|
|
||||||
unsigned ID;
|
|
||||||
Init *Name;
|
Init *Name;
|
||||||
// Location where record was instantiated, followed by the location of
|
// Location where record was instantiated, followed by the location of
|
||||||
// multiclass prototypes used.
|
// multiclass prototypes used.
|
||||||
@ -1166,6 +1164,10 @@ class Record {
|
|||||||
RecordKeeper &TrackedRecords;
|
RecordKeeper &TrackedRecords;
|
||||||
|
|
||||||
std::unique_ptr<DefInit> TheInit;
|
std::unique_ptr<DefInit> TheInit;
|
||||||
|
|
||||||
|
// Unique record ID.
|
||||||
|
unsigned ID;
|
||||||
|
|
||||||
bool IsAnonymous;
|
bool IsAnonymous;
|
||||||
|
|
||||||
// Class-instance values can be used by other defs. For example, Struct<i>
|
// Class-instance values can be used by other defs. For example, Struct<i>
|
||||||
@ -1187,8 +1189,8 @@ public:
|
|||||||
// Constructs a record.
|
// Constructs a record.
|
||||||
explicit Record(Init *N, ArrayRef<SMLoc> locs, RecordKeeper &records,
|
explicit Record(Init *N, ArrayRef<SMLoc> locs, RecordKeeper &records,
|
||||||
bool Anonymous = false) :
|
bool Anonymous = false) :
|
||||||
ID(LastID++), Name(N), Locs(locs.begin(), locs.end()),
|
Name(N), Locs(locs.begin(), locs.end()), TrackedRecords(records),
|
||||||
TrackedRecords(records), IsAnonymous(Anonymous), ResolveFirst(false) {
|
ID(LastID++), IsAnonymous(Anonymous), ResolveFirst(false) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
explicit Record(const std::string &N, ArrayRef<SMLoc> locs,
|
explicit Record(const std::string &N, ArrayRef<SMLoc> locs,
|
||||||
@ -1200,11 +1202,10 @@ public:
|
|||||||
// ID number. Don't copy TheInit either since it's owned by the original
|
// ID number. Don't copy TheInit either since it's owned by the original
|
||||||
// record. All other fields can be copied normally.
|
// record. All other fields can be copied normally.
|
||||||
Record(const Record &O) :
|
Record(const Record &O) :
|
||||||
ID(LastID++), Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
|
Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
|
||||||
Values(O.Values), SuperClasses(O.SuperClasses),
|
Values(O.Values), SuperClasses(O.SuperClasses),
|
||||||
SuperClassRanges(O.SuperClassRanges), TrackedRecords(O.TrackedRecords),
|
SuperClassRanges(O.SuperClassRanges), TrackedRecords(O.TrackedRecords),
|
||||||
IsAnonymous(O.IsAnonymous),
|
ID(LastID++), IsAnonymous(O.IsAnonymous), ResolveFirst(O.ResolveFirst) { }
|
||||||
ResolveFirst(O.ResolveFirst) { }
|
|
||||||
|
|
||||||
static unsigned getNewUID() { return LastID++; }
|
static unsigned getNewUID() { return LastID++; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user