[cfe-commits] r161615 - /cfe/trunk/lib/Sema/SemaStmt.cpp
Chad Rosier
mcrosier at apple.com
Thu Aug 9 13:52:43 PDT 2012
Author: mcrosier
Date: Thu Aug 9 15:52:43 2012
New Revision: 161615
URL: http://llvm.org/viewvc/llvm-project?rev=161615&view=rev
Log:
[ms-inline asm] Simplify logic for empty asm statements.
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=161615&r1=161614&r2=161615&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Aug 9 15:52:43 2012
@@ -2888,6 +2888,16 @@
// MS-style inline assembly is not fully supported, so emit a warning.
Diag(AsmLoc, diag::warn_unsupported_msasm);
+ // Empty asm statements don't need to instantiate the AsmParser, etc.
+ if (AsmToks.empty()) {
+ std::string AsmString;
+ MSAsmStmt *NS =
+ new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
+ /* IsVolatile */ true, AsmToks, LineEnds,
+ AsmString, EndLoc);
+ return Owned(NS);
+ }
+
std::string AsmString = buildMSAsmString(*this, AsmToks, LineEnds);
bool IsSimple;
More information about the cfe-commits
mailing list