diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-08-07 20:51:16 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-08-07 20:51:16 +0000 |
commit | 88d99e4f427350dc788a6a0a71c2f93be59a7cde (patch) | |
tree | 3720a7645fbbd613f842c0f14aadc4385415939b /clang/lib/Frontend/FrontendAction.cpp | |
parent | ec2fac8a133bb6f28b8c38e47767b7e9e429e16d (diff) | |
download | bcm5719-llvm-88d99e4f427350dc788a6a0a71c2f93be59a7cde.tar.gz bcm5719-llvm-88d99e4f427350dc788a6a0a71c2f93be59a7cde.zip |
Flip the order the preprocessor and frontendaction are informed of the end of a file.
This allows using EndOfMainFile from a PPCallback to access data from the
action. The pattern of PPCallback referencing an action is common in clang-tidy.
Differential Revision: http://reviews.llvm.org/D4773
llvm-svn: 215145
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 791017924d6..cf13d7b9ba8 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -432,6 +432,10 @@ void FrontendAction::EndSourceFile() { // Inform the diagnostic client we are done with this source file. CI.getDiagnosticClient().EndSourceFile(); + // Inform the preprocessor we are done. + if (CI.hasPreprocessor()) + CI.getPreprocessor().EndSourceFile(); + // Finalize the action. EndSourceFileAction(); @@ -453,10 +457,6 @@ void FrontendAction::EndSourceFile() { CI.setASTConsumer(nullptr); } - // Inform the preprocessor we are done. - if (CI.hasPreprocessor()) - CI.getPreprocessor().EndSourceFile(); - if (CI.getFrontendOpts().ShowStats) { llvm::errs() << "\nSTATISTICS FOR '" << getCurrentFile() << "':\n"; CI.getPreprocessor().PrintStats(); |