From: David Greene Date: Wed, 19 Oct 2011 13:03:30 +0000 (+0000) Subject: Resolve Record Names X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c42bcf2ca4844162b427d017fa419bf93f258e3;p=oota-llvm.git 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 --- diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 69d31fe3b43..a22c80c5e2e 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; }