summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r--clang/lib/AST/Stmt.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 763f8bd33a3..5e7a13e09d9 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -584,13 +584,14 @@ AsmStmt::AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
}
MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
- SmallVectorImpl<Token> &asmtoks,
+ ArrayRef<Token> asmtoks,
std::string &asmstr, SourceLocation endloc)
: Stmt(MSAsmStmtClass), AsmLoc(asmloc), EndLoc(endloc),
- AsmToks(asmtoks.size()), AsmStr(asmstr),
- IsSimple(true), IsVolatile(true) {
- for (unsigned i = 0, e = asmtoks.size(); i != e; ++i)
- AsmToks.push_back(asmtoks[i]);
+ AsmStr(asmstr), IsSimple(true), IsVolatile(true), NumAsmToks(asmtoks.size()) {
+
+ AsmToks = new (C) Token[NumAsmToks];
+ for (unsigned i = 0, e = NumAsmToks; i != e; ++i)
+ AsmToks[i] = asmtoks[i];
}
ObjCForCollectionStmt::ObjCForCollectionStmt(Stmt *Elem, Expr *Collect,
OpenPOWER on IntegriCloud