Not tracking these commits too closely, but MSAsmStmt's constructor can probably just take a StringRef instead of a std::string&. That would make the extra std::string here unnecessary.
On Aug 9, 2012, at 1:52 PM, Chad Rosier <[email protected]> wrote: > 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; > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
