summaryrefslogtreecommitdiff
path: root/source/slang/ir.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-10-30 15:31:27 -0400
committerGitHub <noreply@github.com>2018-10-30 15:31:27 -0400
commitbaf06088dff0b961843ad03efd75ff009befec5c (patch)
tree6720c4b5015ff50dd14d7654d5d3fdae01a6ef7e /source/slang/ir.h
parent2a7644980035bfda0aab00f183154ab7e976ba63 (diff)
Feature/serial string pool refactor (#702)
* Ongoing serialization for full debug work. * Use StringRepresentationCache and StringSlicePool for serialization. * Removed some older path handling for serialization which had some wrong underlying assumptions. * Builds with refactored use of SubStringPool in ir-serialize. * Removed prohibitedCategories because not used anywhere. * Add category 'compatibility-issue' * Remove work in progress on debug serialization.
Diffstat (limited to 'source/slang/ir.h')
-rw-r--r--source/slang/ir.h27
1 files changed, 6 insertions, 21 deletions
diff --git a/source/slang/ir.h b/source/slang/ir.h
index e54a32043..41c9ab6ab 100644
--- a/source/slang/ir.h
+++ b/source/slang/ir.h
@@ -12,6 +12,7 @@
#include "source-loc.h"
#include "../core/slang-memory-arena.h"
+#include "../core/slang-object-scope-manager.h"
#include "type-system-shared.h"
@@ -1073,32 +1074,15 @@ struct IRModule : RefObject
IRInstListBase getGlobalInsts() const { return getModuleInst()->getChildren(); }
- void addRefObjectToFree(RefObject* obj)
- {
- if (obj)
- {
- obj->addReference();
- m_refObjectsToFree.Add(obj);
- }
- }
-
+ /// Get the object scope manager
+ SLANG_FORCE_INLINE ObjectScopeManager* getObjectScopeManager() { return &m_objectScopeManager; }
+
/// Ctor
IRModule():
memoryArena(kMemoryArenaBlockSize)
{
}
- ~IRModule()
- {
- // Release all ref objects
- for (RefObject* ptr: m_refObjectsToFree)
- {
- ptr->releaseReference();
- }
- // Clear any memory too
- m_refObjectsToFree = List<RefObject*>();
- }
-
MemoryArena memoryArena;
// The compilation session in use.
@@ -1106,7 +1090,8 @@ struct IRModule : RefObject
IRModuleInst* moduleInst;
protected:
- List<RefObject*> m_refObjectsToFree;
+
+ ObjectScopeManager m_objectScopeManager;
};
void printSlangIRAssembly(StringBuilder& builder, IRModule* module);