[clang] 60cba34 - [Clang] When -ftime-trace is used, clean CompilerInstance::OutputFiles before exiting cc_main()

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 14:03:22 PST 2020


Author: Alexandre Ganea
Date: 2020-02-12T17:02:57-05:00
New Revision: 60cba345ca395ea991d7f2596c4a93439fbf9924

URL: https://github.com/llvm/llvm-project/commit/60cba345ca395ea991d7f2596c4a93439fbf9924
DIFF: https://github.com/llvm/llvm-project/commit/60cba345ca395ea991d7f2596c4a93439fbf9924.diff

LOG: [Clang] When -ftime-trace is used, clean CompilerInstance::OutputFiles before exiting cc_main()

This fixes cc1 execution when '-disable-free' is not used (currently not the case, that flag is always used for cc1).

Added: 
    

Modified: 
    clang/tools/driver/cc1_main.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp
index 6d1a67f2a4fa..d8c22f21706b 100644
--- a/clang/tools/driver/cc1_main.cpp
+++ b/clang/tools/driver/cc1_main.cpp
@@ -259,6 +259,7 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
       // FIXME(ibiryukov): make profilerOutput flush in destructor instead.
       profilerOutput->flush();
       llvm::timeTraceProfilerCleanup();
+      Clang->clearOutputFiles(false);
     }
   }
 


        


More information about the cfe-commits mailing list