diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-18 09:36:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-18 09:36:27 +0000 |
commit | a5251fcf79ae9707680d656377a6e43dcbff6c25 (patch) | |
tree | 7499f43713215e2a86f62ba02b494370ce97fe55 /lib/Frontend/PCHWriter.cpp | |
parent | 8f4e18fce5ef11a4e1bcb9dd7adcd2e20a21ef0a (diff) |
rewrite the goto scope checking code to be more efficient, simpler,
produce better diagnostics, and be more correct in ObjC cases (fixing
rdar://6803963).
An example is that we now diagnose:
int test1(int x) {
goto L;
int a[x];
int b[x];
L:
return sizeof a;
}
with:
scope-check.c:15:3: error: illegal goto into protected scope
goto L;
^
scope-check.c:17:7: note: scope created by variable length array
int b[x];
^
scope-check.c:16:7: note: scope created by variable length array
int a[x];
^
instead of just saying "invalid jump". An ObjC example is:
void test1() {
goto L;
@try {
L: ;
} @finally {
}
}
t.m:6:3: error: illegal goto into protected scope
goto L;
^
t.m:7:3: note: scope created by @try block
@try {
^
There are a whole ton of fixme's for stuff to do, but I believe that this
is a monotonic improvement over what we had.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
0 files changed, 0 insertions, 0 deletions