]> granicus.if.org Git - clang/commit
Alter the internal representation of the condition variable in
authorDouglas Gregor <dgregor@apple.com>
Mon, 21 Jun 2010 23:44:13 +0000 (23:44 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 21 Jun 2010 23:44:13 +0000 (23:44 +0000)
commit43dec6bbde2d0a16c35978983761c8b7030c8e18
tree2d3594398e10d024662f8425dcebf6954ed553ad
parent581c78fcb238bbc962176c3dd8399770343c26eb
Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Stmt.h
lib/AST/Stmt.cpp
lib/Frontend/PCHReaderStmt.cpp
lib/Sema/JumpDiagnostics.cpp
lib/Sema/SemaStmt.cpp