[llvm] r258064 - [TableGen] Reorder fields in Record class to optimize memory usage. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 18 11:52:29 PST 2016
Author: ctopper
Date: Mon Jan 18 13:52:29 2016
New Revision: 258064
URL: http://llvm.org/viewvc/llvm-project?rev=258064&view=rev
Log:
[TableGen] Reorder fields in Record class to optimize memory usage. NFC
Modified:
llvm/trunk/include/llvm/TableGen/Record.h
Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=258064&r1=258063&r2=258064&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Mon Jan 18 13:52:29 2016
@@ -1151,8 +1151,6 @@ inline raw_ostream &operator<<(raw_ostre
class Record {
static unsigned LastID;
- // Unique record ID.
- unsigned ID;
Init *Name;
// Location where record was instantiated, followed by the location of
// multiclass prototypes used.
@@ -1166,6 +1164,10 @@ class Record {
RecordKeeper &TrackedRecords;
std::unique_ptr<DefInit> TheInit;
+
+ // Unique record ID.
+ unsigned ID;
+
bool IsAnonymous;
// Class-instance values can be used by other defs. For example, Struct<i>
@@ -1187,8 +1189,8 @@ public:
// Constructs a record.
explicit Record(Init *N, ArrayRef<SMLoc> locs, RecordKeeper &records,
bool Anonymous = false) :
- ID(LastID++), Name(N), Locs(locs.begin(), locs.end()),
- TrackedRecords(records), IsAnonymous(Anonymous), ResolveFirst(false) {
+ Name(N), Locs(locs.begin(), locs.end()), TrackedRecords(records),
+ ID(LastID++), IsAnonymous(Anonymous), ResolveFirst(false) {
init();
}
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
// record. All other fields can be copied normally.
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),
SuperClassRanges(O.SuperClassRanges), TrackedRecords(O.TrackedRecords),
- IsAnonymous(O.IsAnonymous),
- ResolveFirst(O.ResolveFirst) { }
+ ID(LastID++), IsAnonymous(O.IsAnonymous), ResolveFirst(O.ResolveFirst) { }
static unsigned getNewUID() { return LastID++; }
More information about the llvm-commits
mailing list