]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] Use StringRef here, per Jordan's suggestion.
authorChad Rosier <mcrosier@apple.com>
Thu, 9 Aug 2012 21:06:32 +0000 (21:06 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 9 Aug 2012 21:06:32 +0000 (21:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161619 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Stmt.h
lib/AST/Stmt.cpp
lib/Sema/SemaStmt.cpp

index 5a082b7ecfc088b09b7b5c66f5ad39b5603b4bb3..f119637af90026f4fb1e360c4fae45298f4815f7 100644 (file)
@@ -1636,7 +1636,7 @@ class MSAsmStmt : public Stmt {
 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; }
index e5ff75eac6d1f727e59633df37ef2e6dab74cb28..f676711d7cc2f448b1bf83d5b8f7969b5a8bf633 100644 (file)
@@ -585,10 +585,10 @@ AsmStmt::AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
 
 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];
index 856a60203d4ba50aa99ceb23c39ae261a48f21cf..944fc40aadb18b92c67f80a7aed769a72d094dcf 100644 (file)
@@ -2890,7 +2890,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
 
   // 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,