File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1120,10 +1120,14 @@ void FrontendAction::EndSourceFile() {
11201120
11211121 if (CI.getFrontendOpts ().ShowStats ) {
11221122 llvm::errs () << " \n STATISTICS FOR '" << getCurrentFileOrBufferName () << " ':\n " ;
1123- CI.getPreprocessor ().PrintStats ();
1124- CI.getPreprocessor ().getIdentifierTable ().PrintStats ();
1125- CI.getPreprocessor ().getHeaderSearchInfo ().PrintStats ();
1126- CI.getSourceManager ().PrintStats ();
1123+ if (CI.hasPreprocessor ()) {
1124+ CI.getPreprocessor ().PrintStats ();
1125+ CI.getPreprocessor ().getIdentifierTable ().PrintStats ();
1126+ CI.getPreprocessor ().getHeaderSearchInfo ().PrintStats ();
1127+ }
1128+ if (CI.hasSourceManager ()) {
1129+ CI.getSourceManager ().PrintStats ();
1130+ }
11271131 llvm::errs () << " \n " ;
11281132 }
11291133
Original file line number Diff line number Diff line change 1+ ; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -print-stats \
2+ ; RUN: -emit-llvm -x ir %s -o - 2>&1 | FileCheck %s
3+
4+ ; CHECK: *** Source Manager Stats
5+ ; CHECK: *** File Manager Stats
6+ ; CHECK: *** Virtual File System Stats
You can’t perform that action at this time.
0 commit comments