diff options
| author | Tim Foley <tim.foley.is@gmail.com> | 2017-08-14 18:50:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-14 18:50:46 -0700 |
| commit | aeb247cdf02e4dcfc0bb6839cfd291be5128f8ad (patch) | |
| tree | 7314b26e21ded966b6a4fe2430f0421c0c0970bd /source/slang/compiler.h | |
| parent | bb66d6eddd649d8861cecefa2d6ccb7a28a827bc (diff) | |
| parent | 9885c972a6bfa6f856e505cdd90d9b71fdbdadaf (diff) | |
Merge pull request #159 from tfoleyNV/name-type
Name type
Diffstat (limited to 'source/slang/compiler.h')
| -rw-r--r-- | source/slang/compiler.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/slang/compiler.h b/source/slang/compiler.h index a2d29f445..b6eca1b36 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -4,6 +4,7 @@ #include "../core/basic.h" #include "diagnostics.h" +#include "name.h" #include "profile.h" #include "syntax.h" @@ -90,7 +91,7 @@ namespace Slang CompileRequest* compileRequest = nullptr; // The name of the entry point function (e.g., `main`) - String name; + Name* name; // The profile that the entry point will be compiled for // (this is a combination of the target state, and also @@ -222,6 +223,11 @@ namespace Slang SourceManager sourceManagerStorage; SourceManager* sourceManager; + // Name pool for looking up names + NamePool namePool; + + NamePool* getNamePool() { return &namePool; } + // Output stuff DiagnosticSink mSink; String mDiagnosticOutput; @@ -241,7 +247,7 @@ namespace Slang Dictionary<String, RefPtr<ModuleDecl>> mapPathToLoadedModule; // Map from the path of a module file to its definition - Dictionary<String, RefPtr<ModuleDecl>> mapNameToLoadedModules; + Dictionary<Name*, RefPtr<ModuleDecl>> mapNameToLoadedModules; CompileRequest(Session* session); @@ -277,7 +283,7 @@ namespace Slang Profile profile); RefPtr<ModuleDecl> loadModule( - String const& name, + Name* name, String const& path, String const& source, SourceLoc const& loc); @@ -287,8 +293,8 @@ namespace Slang TokenList const& tokens); RefPtr<ModuleDecl> findOrImportModule( - String const& name, - SourceLoc const& loc); + Name* name, + SourceLoc const& loc); SourceManager* getSourceManager() { @@ -335,6 +341,14 @@ namespace Slang SourceManager* getBuiltinSourceManager() { return &builtinSourceManager; } + // Name pool stuff for unique-ing identifiers + + RootNamePool rootNamePool; + NamePool namePool; + + RootNamePool* getRootNamePool() { return &rootNamePool; } + NamePool* getNamePool() { return &namePool; } + // // Generated code for stdlib, etc. @@ -372,9 +386,9 @@ namespace Slang Type* getOverloadedType(); Type* getErrorType(); - SyntaxClass<RefObject> findSyntaxClass(String const& name); + SyntaxClass<RefObject> findSyntaxClass(Name* name); - Dictionary<String, SyntaxClass<RefObject> > mapNameToSyntaxClass; + Dictionary<Name*, SyntaxClass<RefObject> > mapNameToSyntaxClass; // |
