[llvm] r186388 - This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.

Vladimir Medic Vladimir.Medic at imgtec.com
Tue Jul 16 02:22:38 PDT 2013


Author: vmedic
Date: Tue Jul 16 04:22:38 2013
New Revision: 186388

URL: http://llvm.org/viewvc/llvm-project?rev=186388&view=rev
Log:
This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.

Modified:
    llvm/trunk/include/llvm/Target/Target.td
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/include/llvm/Target/Target.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=186388&r1=186387&r2=186388&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/Target.td (original)
+++ llvm/trunk/include/llvm/Target/Target.td Tue Jul 16 04:22:38 2013
@@ -444,6 +444,9 @@ class Instruction {
   /// constraint. For example, "$Rn = $Rd".
   string TwoOperandAliasConstraint = "";
 
+  /// Does the instruction mnemonic allow '.'
+  bit MnemonicContainsDot = 0;
+
   ///@}
 
   /// UseNamedOperandTable - If set, the operand indices of this instruction

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=186388&r1=186387&r2=186388&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Tue Jul 16 04:22:38 2013
@@ -837,9 +837,12 @@ void MatchableInfo::tokenizeAsmString(co
     }
 
     case '.':
-      if (InTok)
-        AsmOperands.push_back(AsmOperand(String.slice(Prev, i)));
-      Prev = i;
+      if (!(TheDef->getValue("MnemonicContainsDot")) ||
+          !(TheDef->getValueAsBit("MnemonicContainsDot"))) {
+        if (InTok)
+          AsmOperands.push_back(AsmOperand(String.slice(Prev, i)));
+        Prev = i;
+      }
       InTok = true;
       break;
 
@@ -2326,7 +2329,7 @@ static void emitMnemonicAliasVariant(raw
   }
   if (AliasesFromMnemonic.empty())
     return;
-    
+
   // Process each alias a "from" mnemonic at a time, building the code executed
   // by the string remapper.
   std::vector<StringMatcher::StringPair> Cases;





More information about the llvm-commits mailing list