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

Chad Rosier mcrosier at apple.com
Wed Aug 22 12:50:28 PDT 2012


Author: mcrosier
Date: Wed Aug 22 14:50:28 2012
New Revision: 162385

URL: http://llvm.org/viewvc/llvm-project?rev=162385&view=rev
Log:
[ms-inline asm] Simplify logic.  No functional change intended.

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=162385&r1=162384&r2=162385&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Wed Aug 22 14:50:28 2012
@@ -360,7 +360,14 @@
   for (unsigned i = 1, e = Pieces.size(); i != e; ++i)
     if (!TI.isValidGCCRegisterName(Pieces[i]))
       return false;
+  return true;
+}
 
+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;
 }
 
@@ -447,12 +454,11 @@
   std::vector<std::vector<StringRef> > Pieces;
   Pieces.resize(NumAsmStrings);
 
-  bool IsSimple = true;
-  for (unsigned i = 0; i != NumAsmStrings; ++i) {
+
+  for (unsigned i = 0; i != NumAsmStrings; ++i)
     buildMSAsmPieces(AsmStrings[i], Pieces[i]);
-    if (IsSimple)
-      IsSimple = isSimpleMSAsm(Pieces[i], Context.getTargetInfo());
-  }
+
+  bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo());
 
   // AsmParser doesn't fully support these asm statements.
   if (bailOnMSAsm(Pieces)) { DEF_SIMPLE_MSASM; return Owned(NS); }





More information about the cfe-commits mailing list