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

Jordan Rose jordan_rose at apple.com
Thu Aug 9 13:56:47 PDT 2012


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 <mcrosier at apple.com> 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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list