summaryrefslogtreecommitdiff
path: root/source/compiler-core/slang-artifact-representation-impl.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-04 17:20:05 -0400
committerGitHub <noreply@github.com>2023-04-04 17:20:05 -0400
commit7bb2de1bc40e535fae93940113db97b5ea44a6f2 (patch)
treea70dcd1c4f97387ba7df482fefcd576c04543606 /source/compiler-core/slang-artifact-representation-impl.h
parent34a2fd593dd5a5d7b597b9d2fe20e39cc24b8e6c (diff)
Simplification around ArtifactRepresentation and unique identity (#2771)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP in handling artifacts/SourceFiles. * Add getUniqueIdentity to IPathArtifactRepresentation * Simplification because around using the representation to provide the uniqueIdentity.
Diffstat (limited to 'source/compiler-core/slang-artifact-representation-impl.h')
-rw-r--r--source/compiler-core/slang-artifact-representation-impl.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/compiler-core/slang-artifact-representation-impl.h b/source/compiler-core/slang-artifact-representation-impl.h
index 4b6d49e06..5c76b9e7c 100644
--- a/source/compiler-core/slang-artifact-representation-impl.h
+++ b/source/compiler-core/slang-artifact-representation-impl.h
@@ -33,6 +33,7 @@ public:
// IPathArtifactRepresentation
virtual SLANG_NO_THROW const char* SLANG_MCALL getPath() SLANG_OVERRIDE { return m_path.getBuffer(); }
virtual SLANG_NO_THROW SlangPathType SLANG_MCALL getPathType() SLANG_OVERRIDE { return SLANG_PATH_TYPE_FILE; }
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getUniqueIdentity() SLANG_OVERRIDE;
// IOSFileArtifactRepresentation
virtual SLANG_NO_THROW Kind SLANG_MCALL getKind() SLANG_OVERRIDE { return m_kind; }
@@ -64,6 +65,8 @@ protected:
Kind m_kind;
String m_path;
+ String m_uniqueIdentity;
+
ComPtr<IOSFileArtifactRepresentation> m_lockFile;
ComPtr<ISlangMutableFileSystem> m_fileSystem;
};
@@ -85,7 +88,8 @@ public:
// IPathArtifactRepresentation
virtual SLANG_NO_THROW const char* SLANG_MCALL getPath() SLANG_OVERRIDE { return m_path.getBuffer(); }
virtual SLANG_NO_THROW SlangPathType SLANG_MCALL getPathType() SLANG_OVERRIDE { return SLANG_PATH_TYPE_FILE; }
-
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getUniqueIdentity() SLANG_OVERRIDE;
+
// IExtFileArtifactRepresentation
virtual SLANG_NO_THROW ISlangFileSystemExt* SLANG_MCALL getFileSystem() SLANG_OVERRIDE { return m_fileSystem; }
@@ -104,6 +108,7 @@ protected:
void* getInterface(const Guid& uuid);
void* getObject(const Guid& uuid);
+ String m_uniqueIdentity;
String m_path;
ComPtr<ISlangFileSystemExt> m_fileSystem;
};
@@ -125,6 +130,7 @@ public:
// IPathArtifactRepresentation
virtual SLANG_NO_THROW const char* SLANG_MCALL getPath() SLANG_OVERRIDE { return m_pathInfo.getName().getBuffer(); }
virtual SLANG_NO_THROW SlangPathType SLANG_MCALL getPathType() SLANG_OVERRIDE { return SLANG_PATH_TYPE_FILE; }
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getUniqueIdentity() SLANG_OVERRIDE { return m_pathInfo.hasUniqueIdentity() ? m_pathInfo.uniqueIdentity.getBuffer() : nullptr; }
SourceBlobWithPathInfoArtifactRepresentation(const PathInfo& pathInfo, ISlangBlob* sourceBlob) :
m_pathInfo(pathInfo),