summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-09 21:06:32 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-09 21:06:32 +0000
commit8640a2a0db441224e03ace2b6029ef33ca734b80 (patch)
treee284956a629bfc4042ac6d2bb3efa6fd8d4c6bc6 /clang/lib
parent6f71e24859be3b72414cdf9b20bb03fe48465011 (diff)
downloadbcm5719-llvm-8640a2a0db441224e03ace2b6029ef33ca734b80.tar.gz
bcm5719-llvm-8640a2a0db441224e03ace2b6029ef33ca734b80.zip
[ms-inline asm] Use StringRef here, per Jordan's suggestion.
llvm-svn: 161619
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Stmt.cpp4
-rw-r--r--clang/lib/Sema/SemaStmt.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index e5ff75eac6d..f676711d7cc 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -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];
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 856a60203d4..944fc40aadb 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -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,
OpenPOWER on IntegriCloud