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 | 99fc38191b9f466fb7d44c1fddf49e766f2de565 (patch) | |
tree | ef9efe9bf1ef91d54d44b6d613a354d396d1a10a /clang/lib/AST | |
parent | 754cedf23fa4451f98b2d529a9b954acd14a4738 (diff) | |
download | bcm5719-llvm-99fc38191b9f466fb7d44c1fddf49e766f2de565.tar.gz bcm5719-llvm-99fc38191b9f466fb7d44c1fddf49e766f2de565.zip |
[ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface.
llvm-svn: 161373
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 11 |
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, |