mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Change name of Record::TheInit to CorrespondingDefInit to make code clearer.
Differential Revision: https://reviews.llvm.org/D87919
This commit is contained in:
parent
fa66d9af58
commit
58f51bc97c
@ -1447,7 +1447,8 @@ class Record {
|
||||
// Tracks Record instances. Not owned by Record.
|
||||
RecordKeeper &TrackedRecords;
|
||||
|
||||
DefInit *TheInit = nullptr;
|
||||
// The DefInit corresponding to this record.
|
||||
DefInit *CorrespondingDefInit = nullptr;
|
||||
|
||||
// Unique record ID.
|
||||
unsigned ID;
|
||||
@ -1471,8 +1472,8 @@ public:
|
||||
: Record(StringInit::get(N), locs, records, false, Class) {}
|
||||
|
||||
// When copy-constructing a Record, we must still guarantee a globally unique
|
||||
// ID number. Don't copy TheInit either since it's owned by the original
|
||||
// record. All other fields can be copied normally.
|
||||
// ID number. Don't copy CorrespondingDefInit either, since it's owned by the
|
||||
// original record. All other fields can be copied normally.
|
||||
Record(const Record &O)
|
||||
: Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
|
||||
Values(O.Values), SuperClasses(O.SuperClasses),
|
||||
@ -1586,7 +1587,8 @@ public:
|
||||
}
|
||||
|
||||
void addSuperClass(Record *R, SMRange Range) {
|
||||
assert(!TheInit && "changing type of record after it has been referenced");
|
||||
assert(!CorrespondingDefInit &&
|
||||
"changing type of record after it has been referenced");
|
||||
assert(!isSubClassOf(R) && "Already subclassing record!");
|
||||
SuperClasses.push_back(std::make_pair(R, Range));
|
||||
}
|
||||
|
@ -2089,9 +2089,9 @@ RecordRecTy *Record::getType() {
|
||||
}
|
||||
|
||||
DefInit *Record::getDefInit() {
|
||||
if (!TheInit)
|
||||
TheInit = new(Allocator) DefInit(this);
|
||||
return TheInit;
|
||||
if (!CorrespondingDefInit)
|
||||
CorrespondingDefInit = new (Allocator) DefInit(this);
|
||||
return CorrespondingDefInit;
|
||||
}
|
||||
|
||||
void Record::setName(Init *NewName) {
|
||||
|
Loading…
Reference in New Issue
Block a user