Mark x86's V_SET0 and V_SETALLONES with isSimpleLoad, and teach X86's
[oota-llvm.git] / utils / TableGen / CodeGenInstruction.cpp
index 53daf9d94463bb0bae3b9cae756c31fe3a5c5bca..a8f747647dc8caf71b5e1a3296066a0d8a80ab7f 100644 (file)
@@ -21,7 +21,8 @@ static void ParseConstraint(const std::string &CStr, CodeGenInstruction *I) {
   // FIXME: Only supports TIED_TO for now.
   std::string::size_type pos = CStr.find_first_of('=');
   assert(pos != std::string::npos && "Unrecognized constraint");
-  std::string Name = CStr.substr(0, pos);
+  std::string::size_type start = CStr.find_first_not_of(" \t");
+  std::string Name = CStr.substr(start, pos);
   
   // TIED_TO: $src1 = $dst
   std::string::size_type wpos = Name.find_first_of(" \t");
@@ -99,6 +100,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
   hasSideEffects = R->getValueAsBit("hasSideEffects");
   mayHaveSideEffects = R->getValueAsBit("mayHaveSideEffects");
   neverHasSideEffects = R->getValueAsBit("neverHasSideEffects");
+  isAsCheapAsAMove = R->getValueAsBit("isAsCheapAsAMove");
   hasOptionalDef = false;
   isVariadic = false;
 
@@ -164,7 +166,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
     } else if (!Rec->isSubClassOf("RegisterClass") && 
                Rec->getName() != "ptr_rc" && Rec->getName() != "unknown")
       throw "Unknown operand class '" + Rec->getName() +
-            "' in instruction '" + R->getName() + "' instruction!";
+            "' in '" + R->getName() + "' instruction!";
 
     // Check that the operand has a name and that it's unique.
     if (DI->getArgName(i).empty())