From c178d8021796807bad0fe6f117d26e3459a92b1d Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 26 Oct 2018 08:24:39 -0700 Subject: [PATCH] Enable timing counters in clang's frontend. This feature can be enabled by setting an env variable ROOT_CLING_TIMING. It prints some information about how much time different parts of clang take. --- lib/Interpreter/CIFactory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Interpreter/CIFactory.cpp b/lib/Interpreter/CIFactory.cpp index b21eaec8..ad1cc34d 100644 --- a/lib/Interpreter/CIFactory.cpp +++ b/lib/Interpreter/CIFactory.cpp @@ -1042,7 +1042,8 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts, } } - Invocation.getFrontendOpts().DisableFree = true; + FrontendOptions FrontendOpts = Invocation.getFrontendOpts(); + FrontendOpts.DisableFree = true; // With modules, we now start adding prebuilt module paths to the CI. // Modules from those paths are treated like they are never out of date @@ -1066,7 +1067,10 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts, /*UserFilesAreVolatile*/ true); CI->setSourceManager(SM); // CI now owns SM - if (Invocation.getFrontendOpts().ModulesEmbedAllFiles) + if (FrontendOpts.ShowTimers) + CI->createFrontendTimer(); + + if (FrontendOpts.ModulesEmbedAllFiles) CI->getSourceManager().setAllFilesAreTransient(true); // As main file we want