summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-10-25 10:14:22 -0700
committerGitHub <noreply@github.com>2024-10-25 10:14:22 -0700
commit4bad669bbc5ec3ff77321f083c59cde87eb10229 (patch)
treebf0abc916692cf34e804469bba400f2b04172472 /include
parentef40d3044cf75ec3d7b24a43257fa744b45274f9 (diff)
Replace stdlib on Slang API with CoreModule (#5405)
This is a breaking change in a way that the Slang API function names are changed. All of them are commented as "experimental" and we wouldn't provide a back-ward compatibility for them. Following functions are renamed: compileStdLib() -> compileCoreModule() loadStdLib() -> loadCoreModule() saveStdLib() -> saveCoreModule() slang_createGlobalSessionWithoutStdLib() -> slang_createGlobalSessionWithoutCoreModule() slang_getEmbeddedStdLib() -> slang_getEmbeddedCoreModule() hasDeferredStdLib() -> hasDeferredCoreModule() Following command-line arguments are renamed: "-load-stdlib" -> "-load-core-module" "-save-stdlib" -> "-save-core-module" "-save-stdlib-bin-source" -> "-save-core-module-bin-source" "-compile-stdlib" -> "-compile-core-module"
Diffstat (limited to 'include')
-rw-r--r--include/slang.h54
1 files changed, 28 insertions, 26 deletions
diff --git a/include/slang.h b/include/slang.h
index 624b66342..c466cd3b6 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -947,13 +947,13 @@ extern "C"
// Internal
ArchiveType,
- CompileStdLib,
+ CompileCoreModule,
Doc,
IrCompression,
- LoadStdLib,
+ LoadCoreModule,
ReferenceModule,
- SaveStdLib,
- SaveStdLibBinSource,
+ SaveCoreModule,
+ SaveCoreModuleBinSource,
TrackLiveness,
LoopInversion, // bool, enable loop inversion optimization
@@ -3307,10 +3307,10 @@ namespace slang
};
- typedef uint32_t CompileStdLibFlags;
- struct CompileStdLibFlag
+ typedef uint32_t CompileCoreModuleFlags;
+ struct CompileCoreModuleFlag
{
- enum Enum : CompileStdLibFlags
+ enum Enum : CompileCoreModuleFlags
{
WriteDocumentation = 0x1,
};
@@ -3482,27 +3482,27 @@ namespace slang
virtual SLANG_NO_THROW SlangResult SLANG_MCALL checkPassThroughSupport(
SlangPassThrough passThrough) = 0;
- /** Compile from (embedded source) the StdLib on the session.
- Will return a failure if there is already a StdLib available
+ /** Compile from (embedded source) the core module on the session.
+ Will return a failure if there is already a core module available
NOTE! API is experimental and not ready for production code
@param flags to control compilation
*/
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL compileStdLib(CompileStdLibFlags flags) = 0;
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL compileCoreModule(CompileCoreModuleFlags flags) = 0;
- /** Load the StdLib. Currently loads modules from the file system.
- @param stdLib Start address of the serialized stdlib
- @param stdLibSizeInBytes The size in bytes of the serialized stdlib
+ /** Load the core module. Currently loads modules from the file system.
+ @param coreModule Start address of the serialized core module
+ @param coreModuleSizeInBytes The size in bytes of the serialized core module
NOTE! API is experimental and not ready for production code
*/
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadStdLib(const void* stdLib, size_t stdLibSizeInBytes) = 0;
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadCoreModule(const void* coreModule, size_t coreModuleSizeInBytes) = 0;
- /** Save the StdLib modules to the file system
- @param archiveType The type of archive used to hold the stdlib
- @param outBlob The serialized blob containing the standard library
+ /** Save the core module to the file system
+ @param archiveType The type of archive used to hold the core module
+ @param outBlob The serialized blob containing the core module
NOTE! API is experimental and not ready for production code */
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveStdLib(SlangArchiveType archiveType, ISlangBlob** outBlob) = 0;
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveCoreModule(SlangArchiveType archiveType, ISlangBlob** outBlob) = 0;
/** Look up the internal ID of a capability by its `name`.
@@ -4232,7 +4232,7 @@ namespace slang
// using.
#define SLANG_API_VERSION 0
-/* Create a global session, with built in StdLib.
+/* Create a global session, with the built-in core module.
@param apiVersion Pass in SLANG_API_VERSION
@param outGlobalSession (out)The created global session.
@@ -4241,22 +4241,24 @@ SLANG_EXTERN_C SLANG_API SlangResult slang_createGlobalSession(
SlangInt apiVersion,
slang::IGlobalSession** outGlobalSession);
-/* Create a global session, but do not set up the stdlib. The stdlib can
-then be loaded via loadStdLib or compileStdLib
+/* Create a global session, but do not set up the core module. The core module can
+then be loaded via loadCoreModule or compileCoreModule
@param apiVersion Pass in SLANG_API_VERSION
-@param outGlobalSession (out)The created global session that doesn't have a StdLib setup.
+@param outGlobalSession (out)The created global session that doesn't have a core module setup.
NOTE! API is experimental and not ready for production code
*/
-SLANG_EXTERN_C SLANG_API SlangResult slang_createGlobalSessionWithoutStdLib(
+SLANG_EXTERN_C SLANG_API SlangResult slang_createGlobalSessionWithoutCoreModule(
SlangInt apiVersion,
slang::IGlobalSession** outGlobalSession);
-/* Returns a blob that contains the serialized stdlib.
-Returns nullptr if there isn't an embedded stdlib.
+/* Returns a blob that contains the serialized core module.
+Returns nullptr if there isn't an embedded core module.
+
+NOTE! API is experimental and not ready for production code
*/
-SLANG_API ISlangBlob* slang_getEmbeddedStdLib();
+SLANG_API ISlangBlob* slang_getEmbeddedCoreModule();
/* Cleanup all global allocations used by Slang, to prevent memory leak detectors from