fix typos and some serious bugs in feature handling (but not for
authorChris Lattner <sabre@nondot.org>
Sat, 30 Oct 2010 19:47:49 +0000 (19:47 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 30 Oct 2010 19:47:49 +0000 (19:47 +0000)
cases that are currently exercised).  Thanks to Frits van Bommel for
the great review!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117840 91177308-0d34-0410-b5e6-96231b3b80d8

docs/CodeGenerator.html
utils/TableGen/AsmMatcherEmitter.cpp

index 60d54e507bc4f6cddb93b5f05caf884d92265b3a..0a7761782545895e5c6fec389cfc9acf88e2a881 100644 (file)
@@ -1909,7 +1909,7 @@ description.</p>
 
 <div class="doc_text">
 
-<p>The first phase of alias processing is simple instruction mneomonic
+<p>The first phase of alias processing is simple instruction mnemonic
 remapping for classes of instructions which are allowed with two different
 mnemonics.  This phase is a simple and unconditionally remapping from one input
 mnemonic to one output mnemonic.  It isn't possible for this form of alias to
index 999c137109b098c856f5f2a2ccb100e07852ef8c..80f5e0841a517ea501af7d463c6772aabf3ebfdc 100644 (file)
@@ -1571,21 +1571,25 @@ static bool EmitMnemonicAliases(raw_ostream &OS) {
           // We can't have two aliases from the same mnemonic with no predicate.
           PrintError(ToVec[AliasWithNoPredicate]->getLoc(),
                      "two MnemonicAliases with the same 'from' mnemonic!");
-          PrintError(R->getLoc(), "this is the other MnemonicAliases.");
-          throw std::string("ERROR: Invalid MnemonicAliases definitions!");
+          PrintError(R->getLoc(), "this is the other MnemonicAlias.");
+          throw std::string("ERROR: Invalid MnemonicAlias definitions!");
         }
         
         AliasWithNoPredicate = i;
         continue;
       }
      
+      if (!MatchCode.empty())
+        MatchCode += "else ";
       MatchCode += "if ((Features & " + FeatureMask + ") == "+FeatureMask+")\n";
       MatchCode += "  Mnemonic = \"" +R->getValueAsString("ToMnemonic")+"\";\n";
     }
     
     if (AliasWithNoPredicate != -1) {
       Record *R = ToVec[AliasWithNoPredicate];
-      MatchCode += "Mnemonic = \"" + R->getValueAsString("ToMnemonic") + "\";";
+      if (!MatchCode.empty())
+        MatchCode += "else\n  ";
+      MatchCode += "Mnemonic = \"" + R->getValueAsString("ToMnemonic")+"\";\n";
     }
     
     MatchCode += "return;";