summaryrefslogtreecommitdiff
path: root/source/slang/slang-compiler.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-22 07:14:55 -0800
committerGitHub <noreply@github.com>2024-02-22 07:14:55 -0800
commit8ec5b3e6ef2e7e5c3adaa5accb375676b1c09ff0 (patch)
treef3023dc51c32d74d1b5dd4701f5535c8227fe17e /source/slang/slang-compiler.h
parentc5ac7dee8a47dcb168a6556d2e8cdb8d2fe09a37 (diff)
Add API for querying and reusing precompiled binary modules. (#3614)
Diffstat (limited to 'source/slang/slang-compiler.h')
-rwxr-xr-xsource/slang/slang-compiler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h
index 7da003b8a..6c55a7807 100755
--- a/source/slang/slang-compiler.h
+++ b/source/slang/slang-compiler.h
@@ -256,6 +256,12 @@ namespace Slang
/// Add all of the paths that `module` depends on to the list
void addDependency(Module* module);
+ void clear()
+ {
+ m_fileList.clear();
+ m_fileSet.clear();
+ }
+
private:
// TODO: We are using a `HashSet` here to deduplicate
@@ -1400,6 +1406,7 @@ namespace Slang
/// Register a source file that this module depends on
void addFileDependency(SourceFile* sourceFile);
+ void clearFileDependency() { m_fileDependencyList.clear(); }
/// Set the AST for this module.
///
/// This should only be called once, during creation of the module.
@@ -1819,6 +1826,7 @@ namespace Slang
SlangCompileRequest** outCompileRequest) override;
virtual SLANG_NO_THROW SlangInt SLANG_MCALL getLoadedModuleCount() override;
virtual SLANG_NO_THROW slang::IModule* SLANG_MCALL getLoadedModule(SlangInt index) override;
+ virtual SLANG_NO_THROW bool SLANG_MCALL isBinaryModuleUpToDate(const char* modulePath, slang::IBlob* binaryModuleBlob) override;
// Updates the supplied builder with linkage-related information, which includes preprocessor
// defines, the compiler version, and other compiler options. This is then merged with the hash
@@ -1952,6 +1960,8 @@ namespace Slang
DiagnosticSink* sink,
const LoadedModuleDictionary* additionalLoadedModules);
+ SourceFile* loadSourceFile(String pathFrom, String path);
+
void loadParsedModule(
RefPtr<FrontEndCompileRequest> compileRequest,
RefPtr<TranslationUnitRequest> translationUnit,
@@ -1961,6 +1971,8 @@ namespace Slang
/// Load a module of the given name.
Module* loadModule(String const& name);
+ bool isBinaryModuleUpToDate(String fromPath, RiffContainer* container);
+
RefPtr<Module> findOrImportModule(
Name* name,
SourceLoc const& loc,