diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-09 16:54:53 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-09 16:54:53 +0000 |
commit | 12e730c6e37e7f4c31e8007902be9e3f8fc85893 (patch) | |
tree | a0525eee37afe37bc8669ce346521842c9063d38 /clang/lib/Driver/Driver.cpp | |
parent | e04395e2f4a7a2a1e03b59cc687ac56f0854381b (diff) | |
download | bcm5719-llvm-12e730c6e37e7f4c31e8007902be9e3f8fc85893.tar.gz bcm5719-llvm-12e730c6e37e7f4c31e8007902be9e3f8fc85893.zip |
Better parser recovery in Objective-C containers.
Previously it was possible to get an infinite-loop-on-invalid with a namespace
decl within @interface. Since 'namespace' is normally a safe place to retry
top-level parsing, we just didn't consume the token.
This adds a flag that tracks whether we have temporarily left Objective-C
scope to parse a C-like declaration, and uses that to better recover from
parse problems by stopping at possible method declarations and at @end. To
fix the original problem, we do /not/ stop at 'namespace' when in an
Objective-C @interface or @protocol context (but still do in @implementation).
llvm-svn: 159941
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
0 files changed, 0 insertions, 0 deletions