]> granicus.if.org Git - clang/commit
Fix <rdar://problem/6451399> problems with labels and blocks.
authorSteve Naroff <snaroff@apple.com>
Sat, 28 Feb 2009 16:48:43 +0000 (16:48 +0000)
committerSteve Naroff <snaroff@apple.com>
Sat, 28 Feb 2009 16:48:43 +0000 (16:48 +0000)
commitf3cf89737965352ee02026992e2dc735824e185e
tree0d89375c08f27cb246c86fa93f7d114a7e4794ca
parent10b26140bcd94373b63ff5c0811a552342c7c512
Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65694 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Scope.h
lib/Sema/Sema.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaStmt.cpp
test/Sema/block-labels.c [new file with mode: 0644]