diff options
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index f6ad7c8..2d77f06 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -1074,10 +1074,14 @@ void FrontendAction::EndSourceFile() { if (CI.getFrontendOpts().ShowStats) { llvm::errs() << "\nSTATISTICS FOR '" << getCurrentFileOrBufferName() << "':\n"; - CI.getPreprocessor().PrintStats(); - CI.getPreprocessor().getIdentifierTable().PrintStats(); - CI.getPreprocessor().getHeaderSearchInfo().PrintStats(); - CI.getSourceManager().PrintStats(); + if (CI.hasPreprocessor()) { + CI.getPreprocessor().PrintStats(); + CI.getPreprocessor().getIdentifierTable().PrintStats(); + CI.getPreprocessor().getHeaderSearchInfo().PrintStats(); + } + if (CI.hasSourceManager()) { + CI.getSourceManager().PrintStats(); + } llvm::errs() << "\n"; } |