summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-10-30 17:28:55 -0400
committerGitHub <noreply@github.com>2019-10-30 17:28:55 -0400
commit72f86c8273b196d204213f02e73ba772201f903d (patch)
tree914f750180e75c6d549bf0be80e9877f4f35c8ed /source/core
parent066bc37f34ab4f72edef2b71fab50b45c3bb627e (diff)
WIP: Simple separate IR module linkage working (#1100)
* Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary.
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-riff.cpp13
-rw-r--r--source/core/slang-riff.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/source/core/slang-riff.cpp b/source/core/slang-riff.cpp
index 3a3722bb8..2e633f2e7 100644
--- a/source/core/slang-riff.cpp
+++ b/source/core/slang-riff.cpp
@@ -535,6 +535,19 @@ RiffContainer::Chunk* RiffContainer::ListChunk::findContained(FourCC fourCC) con
return nullptr;
}
+void RiffContainer::ListChunk::findContained(FourCC type, List<ListChunk*>& out)
+{
+ Chunk* chunk = m_containedChunks;
+ while (chunk)
+ {
+ if (chunk->m_fourCC == type && chunk->m_kind == Chunk::Kind::List)
+ {
+ out.add(static_cast<ListChunk*>(chunk));
+ }
+ chunk = chunk->m_next;
+ }
+}
+
RiffContainer::Data* RiffContainer::ListChunk::findContainedData(FourCC type) const
{
Chunk* found = findContained(type);
diff --git a/source/core/slang-riff.h b/source/core/slang-riff.h
index 4d23e45c1..99d078625 100644
--- a/source/core/slang-riff.h
+++ b/source/core/slang-riff.h
@@ -245,6 +245,9 @@ public:
template <typename T>
T* findContainedData(FourCC type) const { return (T*)findContainedData(type, sizeof(T)); }
+ /// Find all contained that match the type
+ void findContained(FourCC type, List<ListChunk*>& out);
+
/// Find the list (including self) that matches subtype recursively
ListChunk* findListRec(FourCC subType);