diff options
| author | Yong He <yonghe@outlook.com> | 2018-02-20 23:55:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-20 23:55:51 -0500 |
| commit | 01c4134d33cea3a4f98fad9248584278fd4bc452 (patch) | |
| tree | 8ca6b0f7e844fbf56cb1991284aff3ebbcc8aa89 /source/slang/compiler.h | |
| parent | 51cdcad24b5271ac8c0f816174c6a760e264ed9e (diff) | |
| parent | 4cf46e5c8b2af8a4ea4db15cd402aae4145a614c (diff) | |
Merge pull request #417 from csyonghe/leakfix
Fix IR memory leaks.
Diffstat (limited to 'source/slang/compiler.h')
| -rw-r--r-- | source/slang/compiler.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/slang/compiler.h b/source/slang/compiler.h index fab1e19c8..845de5c81 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -179,7 +179,7 @@ namespace Slang // This will only be valid/non-null after semantic // checking and IR generation are complete, so it // is not safe to use this field without testing for NULL. - IRModule* irModule; + RefPtr<IRModule> irModule; }; // A request to generate output in some target format @@ -225,7 +225,7 @@ namespace Slang RefPtr<ModuleDecl> moduleDecl; // The IR for the module - IRModule* irModule = nullptr; + RefPtr<IRModule> irModule = nullptr; }; class Session; @@ -313,6 +313,8 @@ namespace Slang // Map from the logical name of a module to its definition Dictionary<Name*, RefPtr<LoadedModule>> mapNameToLoadedModules; + // The resulting specialized IR module for each entry point request + List<RefPtr<IRModule>> compiledModules; CompileRequest(Session* session); @@ -450,7 +452,6 @@ namespace Slang Dictionary<int, RefPtr<Type>> builtinTypes; Dictionary<String, Decl*> magicDecls; - List<RefPtr<Type>> canonicalTypes; void initializeTypes(); @@ -505,6 +506,7 @@ namespace Slang RefPtr<Scope> const& scope, String const& path, String const& source); + ~Session(); }; } |
