summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-23 04:06:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-23 04:06:09 +0000
commit34f30516aa7f32cbff61dc9066f0b332dfd88c2b (patch)
tree3761579a8a9c29f366a7f5a6c805567dfecef066 /clang/lib/Parse/ParseDecl.cpp
parent5c6eab21ebaf93c68b5d1df8b845518ea6f54b63 (diff)
downloadbcm5719-llvm-34f30516aa7f32cbff61dc9066f0b332dfd88c2b.tar.gz
bcm5719-llvm-34f30516aa7f32cbff61dc9066f0b332dfd88c2b.zip
Generate a marker token when entering or leaving a submodule when building a
module. Use the marker to diagnose cases where we try to transition between submodules when not at the top level (most likely because a closing brace was missing at the end of a header file, but is also possible if submodule headers attempt to do something fundamentally non-modular, like our .def files). llvm-svn: 195543
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index b93979127a5..7185de6fede 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1561,6 +1561,9 @@ void Parser::SkipMalformedDecl() {
break;
case tok::eof:
+ case tok::annot_module_begin:
+ case tok::annot_module_end:
+ case tok::annot_module_include:
return;
default:
@@ -3371,7 +3374,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
SmallVector<Decl *, 32> FieldDecls;
// While we still have something to read, read the declarations in the struct.
- while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
+ while (Tok.isNot(tok::r_brace) && !isEofOrEom()) {
// Each iteration of this loop reads one struct-declaration.
// Check for extraneous top-level semicolon.
OpenPOWER on IntegriCloud