[cfe-commits] r161676 - /cfe/trunk/lib/Sema/SemaStmt.cpp

Chad Rosier mcrosier at apple.com
Fri Aug 10 11:20:13 PDT 2012


Author: mcrosier
Date: Fri Aug 10 13:20:12 2012
New Revision: 161676

URL: http://llvm.org/viewvc/llvm-project?rev=161676&view=rev
Log:
[ms-inline asm] Use asserts as these calls are now guarded by identical checks.

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

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=161676&r1=161675&r2=161676&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Fri Aug 10 13:20:12 2012
@@ -2798,16 +2798,14 @@
                                     SourceLocation AsmLoc,
                                     ArrayRef<Token> AsmToks,
                                     const TargetInfo &TI) {
-  // Assume simple asm stmt until we parse a non-register identifer.
-  IsSimple = true;
-
-  if (AsmToks.empty())
-    return "";
-
+  assert (!AsmToks.empty() && "Didn't expect an empty AsmToks!");
   std::string Res;
   IdentifierInfo *II = AsmToks[0].getIdentifierInfo();
   Res = II->getName().str();
 
+  // Assume simple asm stmt until we parse a non-register identifer.
+  IsSimple = true;
+
   // Check the operands.
   for (unsigned i = 1, e = AsmToks.size(); i != e; ++i) {
     if (needSpaceAsmToken(AsmToks[i]))
@@ -2856,9 +2854,7 @@
 static std::string buildMSAsmString(Sema &SemaRef,
                                     ArrayRef<Token> AsmToks,
                                     ArrayRef<unsigned> LineEnds) {
-  if (AsmToks.empty())
-    return "";
-
+  assert (!AsmToks.empty() && "Didn't expect an empty AsmToks!");
   SmallString<512> Asm;
   SmallString<512> TokenBuf;
   TokenBuf.resize(512);





More information about the cfe-commits mailing list