[cfe-commits] r165851 - /cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Chad Rosier mcrosier at apple.com
Fri Oct 12 16:32:11 PDT 2012


Author: mcrosier
Date: Fri Oct 12 18:32:10 2012
New Revision: 165851

URL: http://llvm.org/viewvc/llvm-project?rev=165851&view=rev
Log:
[ms-inline asm] Remove a bunch of parsing code from the front-end.

Modified:
    cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=165851&r1=165850&r2=165851&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Fri Oct 12 18:32:10 2012
@@ -331,25 +331,6 @@
   return Asm;
 }
 
-// Determine if this is a simple MSAsm instruction.
-static bool isSimpleMSAsm(std::vector<StringRef> &Pieces,
-                          const TargetInfo &TI) {
-  for (unsigned i = 1, e = Pieces.size(); i != e; ++i) {
-    if (!TI.isValidGCCRegisterName(Pieces[i]))
-      return false;
-  }
-  return true;
-}
-
-// Determine if this is a simple MSAsm block.
-static bool isSimpleMSAsm(std::vector<std::vector<StringRef> > Pieces,
-                          const TargetInfo &TI) {
-  for (unsigned i = 0, e = Pieces.size(); i != e; ++i)
-    if (!isSimpleMSAsm(Pieces[i], TI))
-      return false;
-  return true;
-}
-
 // Break the AsmString into pieces (i.e., mnemonic and operands).
 static void buildMSAsmPieces(StringRef Asm, std::vector<StringRef> &Pieces) {
   std::pair<StringRef,StringRef> Split = Asm.split(' ');
@@ -447,8 +428,6 @@
   std::vector<std::vector<StringRef> > Pieces(AsmStrings.size());
   buildMSAsmPieces(AsmStrings, Pieces);
 
-  bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo());
-
   // Get the target specific parser.
   std::string Error;
   const std::string &TT = Context.getTargetInfo().getTriple().getTriple();
@@ -640,6 +619,7 @@
     }
   }
 
+  bool IsSimple = Inputs.size() != 0 || Outputs.size() != 0; 
   MSAsmStmt *NS =
     new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
                             /*IsVolatile*/ true, AsmToks, Inputs, Outputs,





More information about the cfe-commits mailing list