[cfe-commits] r161619 - in /cfe/trunk: include/clang/AST/Stmt.h lib/AST/Stmt.cpp lib/Sema/SemaStmt.cpp

Chad Rosier mcrosier at apple.com
Thu Aug 9 14:06:32 PDT 2012


Author: mcrosier
Date: Thu Aug  9 16:06:32 2012
New Revision: 161619

URL: http://llvm.org/viewvc/llvm-project?rev=161619&view=rev
Log:
[ms-inline asm] Use StringRef here, per Jordan's suggestion.

Modified:
    cfe/trunk/include/clang/AST/Stmt.h
    cfe/trunk/lib/AST/Stmt.cpp
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=161619&r1=161618&r2=161619&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Thu Aug  9 16:06:32 2012
@@ -1636,7 +1636,7 @@
 public:
   MSAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
             bool isvolatile, ArrayRef<Token> asmtoks,
-            ArrayRef<unsigned> lineends, std::string &asmstr,
+            ArrayRef<unsigned> lineends, StringRef asmstr,
             SourceLocation endloc);
 
   SourceLocation getAsmLoc() const { return AsmLoc; }

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=161619&r1=161618&r2=161619&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Thu Aug  9 16:06:32 2012
@@ -585,10 +585,10 @@
 
 MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
                      bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
-                     ArrayRef<unsigned> lineends, std::string &asmstr,
+                     ArrayRef<unsigned> lineends, StringRef asmstr,
                      SourceLocation endloc)
   : Stmt(MSAsmStmtClass), AsmLoc(asmloc), EndLoc(endloc),
-    AsmStr(asmstr), IsSimple(issimple), IsVolatile(isvolatile),
+    AsmStr(asmstr.str()), IsSimple(issimple), IsVolatile(isvolatile),
     NumAsmToks(asmtoks.size()), NumLineEnds(lineends.size()) {
 
   AsmToks = new (C) Token[NumAsmToks];

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=161619&r1=161618&r2=161619&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Aug  9 16:06:32 2012
@@ -2890,7 +2890,7 @@
 
   // Empty asm statements don't need to instantiate the AsmParser, etc.
   if (AsmToks.empty()) {
-    std::string AsmString;
+    StringRef AsmString;
     MSAsmStmt *NS =
       new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
                               /* IsVolatile */ true, AsmToks, LineEnds,





More information about the cfe-commits mailing list