summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-include-system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler-core/slang-include-system.cpp')
-rw-r--r--source/compiler-core/slang-include-system.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/compiler-core/slang-include-system.cpp b/source/compiler-core/slang-include-system.cpp
index 891d376f6..455ecde2b 100644
--- a/source/compiler-core/slang-include-system.cpp
+++ b/source/compiler-core/slang-include-system.cpp
@@ -4,9 +4,22 @@
#include "../core/slang-io.h"
#include "../core/slang-string-util.h"
+#include "../core/slang-file-system.h"
+
+#include "slang-slice-allocator.h"
+#include "slang-artifact-impl.h"
+#include "slang-artifact-representation-impl.h"
+
namespace Slang
{
+IncludeSystem::IncludeSystem(SearchDirectoryList* searchDirectories, ISlangFileSystemExt* fileSystemExt, SourceManager* sourceManager) :
+ m_searchDirectories(searchDirectories),
+ m_fileSystemExt(fileSystemExt),
+ m_sourceManager(sourceManager)
+{
+}
+
SlangResult IncludeSystem::findFile(SlangPathType fromPathType, const String& fromPath, const String& path, PathInfo& outPathInfo)
{
String combinedPath;
@@ -119,6 +132,8 @@ SlangResult IncludeSystem::loadFile(const PathInfo& pathInfo, ComPtr<ISlangBlob>
sourceFile = m_sourceManager->createSourceFileWithBlob(pathInfo, foundSourceBlob);
m_sourceManager->addSourceFile(pathInfo.uniqueIdentity, sourceFile);
+ sourceFile->maybeAddArtifact(m_fileSystemExt);
+
outBlob = foundSourceBlob;
return SLANG_OK;
}
@@ -137,6 +152,8 @@ SlangResult IncludeSystem::loadFile(const PathInfo& pathInfo, ComPtr<ISlangBlob>
}
sourceFile->setContents(foundSourceBlob);
+ sourceFile->maybeAddArtifact(m_fileSystemExt);
+
outBlob = foundSourceBlob;
return SLANG_OK;
}