summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-12 16:24:08 -0400
committerGitHub <noreply@github.com>2023-04-12 16:24:08 -0400
commitd631ef9518e3a38bd10949f01700cbcba306252f (patch)
treeeeb065fe132c4fc61d3c484837951fba9ff44b3b /source/slang/slang.cpp
parent2ce42a25d9732650cfac72211aa918e2fa82b8de (diff)
Reading artifact hierarchy from file system interface (#2787)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container. * WIP artifact container format. * Make the root a special case. * Special case if the artifact doesn't have children/associated. * First pass handling of interpretting a file system into artifact hierarchy. * Explain the final structure. Make the file system available. * Remove addArtifact from IArtifact interface - means will be compatible with previous version. * Rename function to get compile result as a filesytem.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 597e27bb9..4904abe03 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -13,6 +13,9 @@
#include "../compiler-core/slang-artifact-desc-util.h"
#include "../compiler-core/slang-artifact-util.h"
#include "../compiler-core/slang-artifact-associated-impl.h"
+#include "../compiler-core/slang-artifact-container-util.h"
+
+#include "../core/slang-memory-file-system.h"
#include "slang-module-library.h"
@@ -5234,6 +5237,23 @@ char const* EndToEndCompileRequest::getEntryPointSource(int entryPointIndex)
return (char const*)getEntryPointCode(entryPointIndex, nullptr);
}
+ISlangMutableFileSystem* EndToEndCompileRequest::getCompileRequestResultAsFileSystem()
+{
+ if (!m_containerFileSystem)
+ {
+ if (m_containerArtifact)
+ {
+ ComPtr<ISlangMutableFileSystem> fileSystem(new MemoryFileSystem);
+ if (SLANG_SUCCEEDED(ArtifactContainerUtil::writeContainer(m_containerArtifact, "", fileSystem)))
+ {
+ m_containerFileSystem.swap(fileSystem);
+ }
+ }
+ }
+
+ return m_containerFileSystem;
+}
+
void const* EndToEndCompileRequest::getCompileRequestCode(size_t* outSize)
{
if (m_containerArtifact)