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
This commit is contained in:
David Greene 2011-10-19 13:03:30 +00:00
parent f628204262
commit 9c42bcf2ca

View File

@ -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; }