summaryrefslogtreecommitdiff
path: root/source/slang/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/compiler.h')
-rw-r--r--source/slang/compiler.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/slang/compiler.h b/source/slang/compiler.h
index a48ad2287..0e85a1088 100644
--- a/source/slang/compiler.h
+++ b/source/slang/compiler.h
@@ -211,6 +211,19 @@ namespace Slang
String path;
};
+ // Represents a module that has been loaded through the front-end
+ // (up through IR generation).
+ //
+ class LoadedModule : public RefObject
+ {
+ public:
+ // The AST for the module
+ RefPtr<ModuleDecl> moduleDecl;
+
+ // The IR for the module
+ IRModule* irModule = nullptr;
+ };
+
class Session;
class CompileRequest : public RefObject
@@ -285,13 +298,13 @@ namespace Slang
// Modules that have been dynamically loaded via `import`
//
// This is a list of unique modules loaded, in the order they were encountered.
- List<RefPtr<ModuleDecl> > loadedModulesList;
+ List<RefPtr<LoadedModule> > loadedModulesList;
// Map from the path of a module file to its definition
- Dictionary<String, RefPtr<ModuleDecl>> mapPathToLoadedModule;
+ Dictionary<String, RefPtr<LoadedModule>> mapPathToLoadedModule;
// Map from the logical name of a module to its definition
- Dictionary<Name*, RefPtr<ModuleDecl>> mapNameToLoadedModules;
+ Dictionary<Name*, RefPtr<LoadedModule>> mapNameToLoadedModules;
CompileRequest(Session* session);
@@ -344,6 +357,11 @@ namespace Slang
String const& path,
TokenList const& tokens);
+ void loadParsedModule(
+ RefPtr<TranslationUnitRequest> const& translationUnit,
+ Name* name,
+ String const& path);
+
RefPtr<ModuleDecl> findOrImportModule(
Name* name,
SourceLoc const& loc);