Add a default constructor to AsmWriterOperand to make VS2008sp1 happy. (AsmWriterOper...
[oota-llvm.git] / utils / TableGen / CodeGenInstruction.cpp
index d52037823f67857c07e171438a64ac4097f47881..2a5b0bf99b409491cac27864647fa03b2f02337e 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");
@@ -163,8 +164,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
       isVariadic = true;
       continue;
     } else if (!Rec->isSubClassOf("RegisterClass") && 
-               Rec->getName() != "ptr_rc" && Rec->getName() != "unknown" &&
-               Rec->getName() != "discard")
+               Rec->getName() != "ptr_rc" && Rec->getName() != "unknown")
       throw "Unknown operand class '" + Rec->getName() +
             "' in instruction '" + R->getName() + "' instruction!";