diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-10-28 16:40:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-28 16:40:53 -0700 |
| commit | b7a619b45b0745f166d2dcc5985b994fb1d85d13 (patch) | |
| tree | a1fbae9702899bf574624641f31bf17d9dd54999 /source/slang/slang.cpp | |
| parent | 80471601720e107f0914479f6097281d0840cf18 (diff) | |
Replace the word stdlib or standard-library with core-module for source code (#5415)
This commit changes the word "stdlib" or "standard library" to "core module" in the source code.
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b3ac7f73d..34b7dd472 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -185,7 +185,7 @@ void Session::init() // Create scopes for various language builtins. // // TODO: load these on-demand to avoid parsing - // stdlib code for languages the user won't use. + // the core module code for languages the user won't use. baseLanguageScope = builtinAstBuilder->create<Scope>(); @@ -312,7 +312,7 @@ SlangResult Session::checkPassThroughSupport(SlangPassThrough inPassThrough) return checkExternalCompilerSupport(this, PassThroughMode(inPassThrough)); } -void Session::writeStdlibDoc(String config) +void Session::writeCoreModuleDoc(String config) { ASTBuilder* astBuilder = getBuiltinLinkage()->getASTBuilder(); SourceManager* sourceManager = getBuiltinSourceManager(); @@ -322,10 +322,10 @@ void Session::writeStdlibDoc(String config) List<String> docStrings; // For all the modules add their doc output to docStrings - for (Module* stdlibModule : stdlibModules) + for (Module* m : coreModules) { RefPtr<ASTMarkup> markup(new ASTMarkup); - ASTMarkupUtil::extract(stdlibModule->getModuleDecl(), sourceManager, &sink, markup); + ASTMarkupUtil::extract(m->getModuleDecl(), sourceManager, &sink, markup); DocMarkdownWriter writer(markup, astBuilder, &sink); auto rootPage = writer.writeAll(config.getUnownedSlice()); @@ -348,26 +348,26 @@ SlangResult Session::compileCoreModule(slang::CompileCoreModuleFlags compileFlag if (m_builtinLinkage->mapNameToLoadedModules.getCount()) { - // Already have a StdLib loaded + // Already have a core module loaded return SLANG_FAIL; } #ifdef _DEBUG - // Print a message in debug builds to notice the user that compiling the stdlib + // Print a message in debug builds to notice the user that compiling the core module // can take a while. time_t beginTime; time(&beginTime); - fprintf(stderr, "Compiling stdlib on debug build, this can take a while.\n"); + fprintf(stderr, "Compiling core module on debug build, this can take a while.\n"); #endif // TODO(JS): Could make this return a SlangResult as opposed to exception - StringBuilder stdLibSrcBuilder; - stdLibSrcBuilder + StringBuilder coreModuleSrcBuilder; + coreModuleSrcBuilder << (const char*)getCoreLibraryCode()->getBufferPointer() << (const char*)getHLSLLibraryCode()->getBufferPointer() << (const char*)getAutodiffLibraryCode()->getBufferPointer(); - auto stdLibSrcBlob = StringBlob::moveCreate(stdLibSrcBuilder.produceString()); - addBuiltinSource(coreLanguageScope, "core", stdLibSrcBlob); + auto coreModuleSrcBlob = StringBlob::moveCreate(coreModuleSrcBuilder.produceString()); + addBuiltinSource(coreLanguageScope, "core", coreModuleSrcBlob); if (compileFlags & slang::CompileCoreModuleFlag::WriteDocumentation) { @@ -379,7 +379,7 @@ SlangResult Session::compileCoreModule(slang::CompileCoreModuleFlags compileFlag } else { - writeStdlibDoc(configText); + writeCoreModuleDoc(configText); } } @@ -388,7 +388,7 @@ SlangResult Session::compileCoreModule(slang::CompileCoreModuleFlags compileFlag #ifdef _DEBUG time_t endTime; time(&endTime); - fprintf(stderr, "Compiling stdlib took %.2f seconds.\n", difftime(endTime, beginTime)); + fprintf(stderr, "Compiling core module took %.2f seconds.\n", difftime(endTime, beginTime)); #endif return SLANG_OK; } @@ -399,7 +399,7 @@ SlangResult Session::loadCoreModule(const void* coreModule, size_t coreModuleSiz if (m_builtinLinkage->mapNameToLoadedModules.getCount()) { - // Already have a StdLib loaded + // Already have a core module loaded return SLANG_FAIL; } @@ -521,7 +521,7 @@ SlangResult Session::_readBuiltinModule(ISlangFileSystem* fileSystem, Scope* sco if (moduleDecl) { - if (isFromStdLib(moduleDecl)) + if (isFromCoreModule(moduleDecl)) { registerBuiltinDecls(this, moduleDecl); } @@ -551,7 +551,7 @@ SlangResult Session::_readBuiltinModule(ISlangFileSystem* fileSystem, Scope* sco // We need to retain this AST so that we can use it in other code // (Note that the `Scope` type does not retain the AST it points to) - stdlibModules.add(module); + coreModules.add(module); } return SLANG_OK; @@ -2937,21 +2937,21 @@ void FrontEndCompileRequest::parseTranslationUnit( module->setModuleDecl(translationUnitSyntax); // When compiling a module of code that belongs to the Slang - // standard library, we add a modifier to the module to act + // core module, we add a modifier to the module to act // as a marker, so that downstream code can detect declarations - // that came from the standard library (by walking up their + // that came from the core module (by walking up their // chain of ancestors and looking for the marker), and treat // them differently from user declarations. // // We are adding the marker here, before we even parse the // code in the module, in case the subsequent steps would - // like to treat the standard library differently. Alternatively + // like to treat the core module differently. Alternatively // we could pass down the `m_isStandardLibraryCode` flag to // these passes. // - if( m_isStandardLibraryCode ) + if( m_isCoreModuleCode ) { - translationUnitSyntax->modifiers.first = astBuilder->create<FromStdLibModifier>(); + translationUnitSyntax->modifiers.first = astBuilder->create<FromCoreModuleModifier>(); } // We use a custom handler for preprocessor callbacks, to @@ -5898,7 +5898,7 @@ void Session::addBuiltinSource( m_builtinLinkage, nullptr, &sink); - compileRequest->m_isStandardLibraryCode = true; + compileRequest->m_isCoreModuleCode = true; // Set the source manager on the sink sink.setSourceManager(sourceManager); @@ -5922,10 +5922,10 @@ void Session::addBuiltinSource( PlatformUtil::outputDebugMessage(diagnostics); - SLANG_UNEXPECTED("error in Slang standard library"); + SLANG_UNEXPECTED("error in Slang core module"); } - // Compiling stdlib should not yield any warnings. + // Compiling the core module should not yield any warnings. SLANG_ASSERT(sink.outputBuffer.getLength() == 0); // Extract the AST for the code we just parsed @@ -5957,7 +5957,7 @@ void Session::addBuiltinSource( // We need to retain this AST so that we can use it in other code // (Note that the `Scope` type does not retain the AST it points to) - stdlibModules.add(module); + coreModules.add(module); } Session::~Session() @@ -5970,7 +5970,7 @@ Session::~Session() globalAstBuilder.setNull(); // destroy modules next - stdlibModules = decltype(stdlibModules)(); + coreModules = decltype(coreModules)(); } } |
