summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-03-07 16:39:35 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-03-07 16:39:35 +0000
commitaa0f752fc83602b005422bfea8e5edd7b2876134 (patch)
treee0a2ce13106e1921152c4837a93f1523f4cbdad9 /llvm/lib/TableGen
parente0691eae7d0d626b27d5a6175995b9d998e1122e (diff)
downloadbcm5719-llvm-aa0f752fc83602b005422bfea8e5edd7b2876134.tar.gz
bcm5719-llvm-aa0f752fc83602b005422bfea8e5edd7b2876134.zip
Fix infinite loop in nested multiclasses.
Patch by Michael Liao! llvm-svn: 152232
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 12d1b1a4c95..93eed24b8dc 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -1726,12 +1726,6 @@ void Record::setName(Init *NewName) {
} // Otherwise this isn't yet registered.
Name = NewName;
checkName();
- // Since the Init for the name was changed, see if we can resolve
- // any of it using members of the Record.
- Init *ComputedName = Name->resolveReferences(*this, 0);
- if (ComputedName != Name) {
- setName(ComputedName);
- }
// DO NOT resolve record values to the name at this point because
// there might be default values for arguments of this def. Those
// arguments might not have been resolved yet so we don't want to
@@ -1754,6 +1748,8 @@ void Record::setName(const std::string &Name) {
/// references.
void Record::resolveReferencesTo(const RecordVal *RV) {
for (unsigned i = 0, e = Values.size(); i != e; ++i) {
+ if (RV == &Values[i]) // Skip resolve the same field as the given one
+ continue;
if (Init *V = Values[i].getValue())
Values[i].setValue(V->resolveReferences(*this, RV));
}
OpenPOWER on IntegriCloud