@@ -2742,6 +2742,7 @@ static void _outputIncludes(const List<SourceFile*>& sourceFiles, SourceManager*
2742
2742
void FrontEndCompileRequest::parseTranslationUnit (
2743
2743
TranslationUnitRequest* translationUnit)
2744
2744
{
2745
+ SLANG_PROFILE;
2745
2746
if (translationUnit->isChecked )
2746
2747
return ;
2747
2748
@@ -2924,6 +2925,7 @@ void FrontEndCompileRequest::checkAllTranslationUnits()
2924
2925
2925
2926
void FrontEndCompileRequest::generateIR ()
2926
2927
{
2928
+ SLANG_PROFILE;
2927
2929
SLANG_AST_BUILDER_RAII (getLinkage ()->getASTBuilder ());
2928
2930
2929
2931
// Our task in this function is to generate IR code
@@ -3021,6 +3023,7 @@ static SourceLanguage inferSourceLanguage(FrontEndCompileRequest* request)
3021
3023
3022
3024
SlangResult FrontEndCompileRequest::executeActionsInner ()
3023
3025
{
3026
+ SLANG_PROFILE_SECTION (frontEndExecute);
3024
3027
SLANG_AST_BUILDER_RAII (getLinkage ()->getASTBuilder ());
3025
3028
3026
3029
for (TranslationUnitRequest* translationUnit : translationUnits)
@@ -3046,7 +3049,11 @@ SlangResult FrontEndCompileRequest::executeActionsInner()
3046
3049
return SLANG_FAIL;
3047
3050
3048
3051
// Perform semantic checking on the whole collection
3049
- checkAllTranslationUnits ();
3052
+ {
3053
+ SLANG_PROFILE_SECTION (SemanticChecking);
3054
+ checkAllTranslationUnits ();
3055
+ }
3056
+
3050
3057
if (getSink ()->getErrorCount () != 0 )
3051
3058
return SLANG_FAIL;
3052
3059
@@ -3172,6 +3179,7 @@ void EndToEndCompileRequest::init()
3172
3179
3173
3180
SlangResult EndToEndCompileRequest::executeActionsInner ()
3174
3181
{
3182
+ SLANG_PROFILE_SECTION (endToEndActions);
3175
3183
// If no code-generation target was specified, then try to infer one from the source language,
3176
3184
// just to make sure we can do something reasonable when invoked from the command line.
3177
3185
//
@@ -6303,6 +6311,7 @@ SlangResult EndToEndCompileRequest::compile()
6303
6311
if (getOptionSet ().getBoolOption (CompilerOptionName::ReportDownstreamTime))
6304
6312
{
6305
6313
getSession ()->getCompilerElapsedTime (&totalStartTime, &downstreamStartTime);
6314
+ PerformanceProfiler::getProfiler ()->clear ();
6306
6315
}
6307
6316
#if !defined(SLANG_DEBUG_INTERNAL_ERROR)
6308
6317
// By default we'd like to catch as many internal errors as possible,
@@ -6317,6 +6326,7 @@ SlangResult EndToEndCompileRequest::compile()
6317
6326
6318
6327
try
6319
6328
{
6329
+ SLANG_PROFILE_SECTION (compileInner);
6320
6330
res = executeActions ();
6321
6331
}
6322
6332
catch (const AbortCompilationException& e)
0 commit comments