Skip to content

Commit 8760cf5

Browse files
committed
Fix build.
1 parent 19b1e50 commit 8760cf5

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

source/slang/slang-compiler.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "slang-check-impl.h"
1717
#include "slang-check.h"
1818

19+
#include <chrono>
20+
1921
// Artifact
2022
#include "../compiler-core/slang-artifact-associated.h"
2123
#include "../compiler-core/slang-artifact-container-util.h"
@@ -1835,6 +1837,26 @@ SlangResult CodeGenContext::_emitEntryPoints(ComPtr<IArtifact>& outArtifact)
18351837
return SLANG_FAIL;
18361838
}
18371839

1840+
// Helper class for recording compile time.
1841+
struct CompileTimerRAII
1842+
{
1843+
std::chrono::high_resolution_clock::time_point startTime;
1844+
Session* session;
1845+
CompileTimerRAII(Session* inSession)
1846+
{
1847+
startTime = std::chrono::high_resolution_clock::now();
1848+
session = inSession;
1849+
}
1850+
~CompileTimerRAII()
1851+
{
1852+
double elapsedTime = std::chrono::duration_cast<std::chrono::microseconds>(
1853+
std::chrono::high_resolution_clock::now() - startTime)
1854+
.count() /
1855+
1e6;
1856+
session->addTotalCompileTime(elapsedTime);
1857+
}
1858+
};
1859+
18381860
// Do emit logic for a zero or more entry points
18391861
SlangResult CodeGenContext::emitEntryPoints(ComPtr<IArtifact>& outArtifact)
18401862
{

source/slang/slang-compiler.h

-20
Original file line numberDiff line numberDiff line change
@@ -3755,26 +3755,6 @@ SLANG_FORCE_INLINE SlangSourceLanguage asExternal(SourceLanguage sourceLanguage)
37553755
return (SlangSourceLanguage)sourceLanguage;
37563756
}
37573757

3758-
// Helper class for recording compile time.
3759-
struct CompileTimerRAII
3760-
{
3761-
std::chrono::high_resolution_clock::time_point startTime;
3762-
Session* session;
3763-
CompileTimerRAII(Session* inSession)
3764-
{
3765-
startTime = std::chrono::high_resolution_clock::now();
3766-
session = inSession;
3767-
}
3768-
~CompileTimerRAII()
3769-
{
3770-
double elapsedTime = std::chrono::duration_cast<std::chrono::microseconds>(
3771-
std::chrono::high_resolution_clock::now() - startTime)
3772-
.count() /
3773-
1e6;
3774-
session->addTotalCompileTime(elapsedTime);
3775-
}
3776-
};
3777-
37783758
// helpers for error/warning reporting
37793759
enum class DiagnosticCategory
37803760
{

0 commit comments

Comments
 (0)