summaryrefslogtreecommitdiff
path: root/lib/TableGen/Record.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-10-19 13:03:30 +0000
committerDavid Greene <greened@obbligato.org>2011-10-19 13:03:30 +0000
commit9c42bcf2ca4844162b427d017fa419bf93f258e3 (patch)
tree550f2c07f6a123d022b327f7588158b6c040d992 /lib/TableGen/Record.cpp
parentf628204262fb91bc095e198b5d9777bd015637e2 (diff)
downloadllvm-9c42bcf2ca4844162b427d017fa419bf93f258e3.tar.gz
llvm-9c42bcf2ca4844162b427d017fa419bf93f258e3.tar.bz2
llvm-9c42bcf2ca4844162b427d017fa419bf93f258e3.tar.xz
Resolve Record Names
When resolving Record values, be sure to update the Record name as it may contain references to the value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen/Record.cpp')
-rw-r--r--lib/TableGen/Record.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp
index 69d31fe3b4..a22c80c5e2 100644
--- a/lib/TableGen/Record.cpp
+++ b/lib/TableGen/Record.cpp
@@ -1764,6 +1764,12 @@ void Record::resolveReferencesTo(const RecordVal *RV) {
if (Init *V = Values[i].getValue())
Values[i].setValue(V->resolveReferences(*this, RV));
}
+ Init *OldName = getNameInit();
+ Init *NewName = Name->resolveReferences(*this, RV);
+ if (NewName != OldName) {
+ // Re-register with RecordKeeper.
+ setName(NewName);
+ }
}
void Record::dump() const { errs() << *this; }