[ms-inline asm] Use StringRef here, per Jordan's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161619 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 5a082b7..f119637 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -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; }
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index e5ff75e..f676711 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -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];
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 856a602..944fc40 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -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,