diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-07 00:29:06 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-07 00:29:06 +0000 |
commit | 79efe24e125553b7fd4a35ffb3b7a45c4f1e661a (patch) | |
tree | 675ab3b90c2cfc01d8c4b2a69ff8bc8b0d1be98d /lib/AST/Stmt.cpp | |
parent | b3f46ec9a479725f54790b8b49cb1636aa2a15c3 (diff) |
[ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 763f8bd33a..5e7a13e09d 100644 --- a/lib/AST/Stmt.cpp +++ b/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, |