summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PrintPreprocessedOutput.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/Frontend/PrintPreprocessedOutput.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/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 55a66d87f8b..f3393bfe51c 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -657,7 +657,9 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok,
// -traditional-cpp the lexer keeps /all/ whitespace, including comments.
SourceLocation StartLoc = Tok.getLocation();
Callbacks->MoveToLine(StartLoc.getLocWithOffset(Tok.getLength()));
- } else if (Tok.is(tok::annot_module_include)) {
+ } else if (Tok.is(tok::annot_module_include) ||
+ Tok.is(tok::annot_module_begin) ||
+ Tok.is(tok::annot_module_end)) {
// PrintPPOutputPPCallbacks::InclusionDirective handles producing
// appropriate output here. Ignore this token entirely.
PP.Lex(Tok);
OpenPOWER on IntegriCloud