]> granicus.if.org Git - clang/commit
Clean up the AST for while loops and fix several problems with
authorDouglas Gregor <dgregor@apple.com>
Tue, 24 Nov 2009 21:15:44 +0000 (21:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 24 Nov 2009 21:15:44 +0000 (21:15 +0000)
commit5656e14d91405417182171a705ed3e3d2d6d7aa3
tree33bb9d6fde39a94e88529a19425acfdf06f2d500
parente9cbf15b2ebedebc8bb8e162bb5cf25abd70f578
Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

   while (shared_ptr<WorkInt> p = getWorkItem()) {
         // ...
         }

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

   while (blah)
     RAIIObject raii(blah+1);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Stmt.h
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CodeGenFunction.h
lib/Frontend/PCHReaderStmt.cpp
lib/Frontend/PCHWriterStmt.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/TreeTransform.h
test/CodeGenCXX/condition.cpp