diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-28 06:53:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-28 06:53:40 +0000 |
commit | e66a8cf9117e5fb95a05ff76ec06615e63dd5ade (patch) | |
tree | 5c604fc36cd99807f6fb57d4c0ebbac9261fc4e0 /lib/AST/CFG.cpp | |
parent | 0632dd6fe068011af5710c0d6a745724021ff620 (diff) |
some random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r-- | lib/AST/CFG.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp index 297758316a..804c2d2bd5 100644 --- a/lib/AST/CFG.cpp +++ b/lib/AST/CFG.cpp @@ -363,15 +363,12 @@ CFGBlock* CFGBuilder::WalkAST(Stmt* Terminator, bool AlwaysAddStmt = false) { return WalkAST_VisitDeclSubExpr(DS->getSingleDecl()); } - typedef llvm::SmallVector<Decl*,10> BufTy; - BufTy Buf; CFGBlock* B = 0; // FIXME: Add a reverse iterator for DeclStmt to avoid this // extra copy. - for (DeclStmt::decl_iterator DI=DS->decl_begin(), DE=DS->decl_end(); - DI != DE; ++DI) - Buf.push_back(*DI); + typedef llvm::SmallVector<Decl*,10> BufTy; + BufTy Buf(DS->decl_begin(), DS->decl_end()); for (BufTy::reverse_iterator I=Buf.rbegin(), E=Buf.rend(); I!=E; ++I) { // Get the alignment of the new DeclStmt, padding out to >=8 bytes. @@ -384,8 +381,7 @@ CFGBlock* CFGBuilder::WalkAST(Stmt* Terminator, bool AlwaysAddStmt = false) { Decl* D = *I; void* Mem = cfg->getAllocator().Allocate(sizeof(DeclStmt), A); - DeclStmt* DS = new (Mem) DeclStmt(DG, D->getLocation(), - GetEndLoc(D)); + DeclStmt* DS = new (Mem) DeclStmt(DG, D->getLocation(), GetEndLoc(D)); // Append the fake DeclStmt to block. Block->appendStmt(DS); |