aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 1995477..87faf77 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -439,6 +439,7 @@ bool TGParser::resolve(const std::vector<RecordsEntry> &Source,
/// Resolve the record fully and add it to the record keeper.
bool TGParser::addDefOne(std::unique_ptr<Record> Rec) {
+ Init *NewName = nullptr;
if (Record *Prev = Records.getDef(Rec->getNameInitAsString())) {
if (!Rec->isAnonymous()) {
PrintError(Rec->getLoc(),
@@ -446,10 +447,10 @@ bool TGParser::addDefOne(std::unique_ptr<Record> Rec) {
PrintNote(Prev->getLoc(), "location of previous definition");
return true;
}
- Rec->setName(Records.getNewAnonymousName());
+ NewName = Records.getNewAnonymousName();
}
- Rec->resolveReferences();
+ Rec->resolveReferences(NewName);
checkConcrete(*Rec);
CheckRecordAsserts(*Rec);