[llvm-commits] [llvm] r117840 - in /llvm/trunk: docs/CodeGenerator.html utils/TableGen/AsmMatcherEmitter.cpp

Chris Lattner sabre at nondot.org
Sat Oct 30 12:47:49 PDT 2010


Author: lattner
Date: Sat Oct 30 14:47:49 2010
New Revision: 117840

URL: http://llvm.org/viewvc/llvm-project?rev=117840&view=rev
Log:
fix typos and some serious bugs in feature handling (but not for
cases that are currently exercised).  Thanks to Frits van Bommel for
the great review!

Modified:
    llvm/trunk/docs/CodeGenerator.html
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/docs/CodeGenerator.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodeGenerator.html?rev=117840&r1=117839&r2=117840&view=diff
==============================================================================
--- llvm/trunk/docs/CodeGenerator.html (original)
+++ llvm/trunk/docs/CodeGenerator.html Sat Oct 30 14:47:49 2010
@@ -1909,7 +1909,7 @@
 
 <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

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=117840&r1=117839&r2=117840&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Oct 30 14:47:49 2010
@@ -1571,21 +1571,25 @@
           // 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;";





More information about the llvm-commits mailing list