Check that MnemonicAlias doesn't map back to the same string.
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 17 Feb 2011 23:22:19 +0000 (23:22 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 17 Feb 2011 23:22:19 +0000 (23:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125792 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/AsmMatcherEmitter.cpp

index 35f5f6facc49fa2dac7b9aaab614886d3cc326ca..e3def4185238f03903baea45c296caee0f4bec23 100644 (file)
@@ -1881,6 +1881,8 @@ static bool EmitMnemonicAliases(raw_ostream &OS, const AsmMatcherInfo &Info) {
         AliasWithNoPredicate = i;
         continue;
       }
+      if (R->getValueAsString("ToMnemonic") == I->first)
+        throw TGError(R->getLoc(), "MnemonicAlias to the same string");
 
       if (!MatchCode.empty())
         MatchCode += "else ";