diff options
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r-- | llvm/lib/TableGen/Record.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 4f1ca04316b..867dd006ed6 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -1572,10 +1572,8 @@ DefInit *VarDefInit::instantiate() { Record *NewRec = NewRecOwner.get(); // Copy values from class to instance - for (const RecordVal &Val : Class->getValues()) { - if (Val.getName() != "NAME") - NewRec->addValue(Val); - } + for (const RecordVal &Val : Class->getValues()) + NewRec->addValue(Val); // Substitute and resolve template arguments ArrayRef<Init *> TArgs = Class->getTemplateArgs(); @@ -1845,14 +1843,6 @@ void RecordVal::print(raw_ostream &OS, bool PrintSem) const { unsigned Record::LastID = 0; -void Record::init() { - checkName(); - - // Every record potentially has a def at the top. This value is - // replaced with the top-level def name at instantiation time. - addValue(RecordVal(StringInit::get("NAME"), StringRecTy::get(), false)); -} - void Record::checkName() { // Ensure the record name has string type. const TypedInit *TypedName = cast<const TypedInit>(Name); @@ -2260,3 +2250,10 @@ Init *TrackUnresolvedResolver::resolve(Init *VarName) { FoundUnresolved = true; return I; } + +Init *HasReferenceResolver::resolve(Init *VarName) +{ + if (VarName == VarNameToTrack) + Found = true; + return nullptr; +} |