summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-artifact-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler-core/slang-artifact-util.cpp')
-rw-r--r--source/compiler-core/slang-artifact-util.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/compiler-core/slang-artifact-util.cpp b/source/compiler-core/slang-artifact-util.cpp
index 9a8194969..7f69a0464 100644
--- a/source/compiler-core/slang-artifact-util.cpp
+++ b/source/compiler-core/slang-artifact-util.cpp
@@ -93,20 +93,16 @@ SlangResult ArtifactUtilImpl::createLockFile(const char* inNameBase, ISlangMutab
SlangResult ArtifactUtilImpl::calcArtifactPath(const ArtifactDesc& desc, const char* inBasePath, ISlangBlob** outPath)
{
UnownedStringSlice basePath(inBasePath);
-
StringBuilder path;
SLANG_RETURN_ON_FAIL(ArtifactDescUtil::calcPathForDesc(desc, basePath, path));
-
- auto blob = new StringBlob(path);
- blob->addRef();
- *outPath = blob;
+ *outPath = StringBlob::create(path).detach();
return SLANG_OK;
}
SlangResult ArtifactUtilImpl::requireFileDefaultImpl(IArtifact* artifact, ArtifactKeep keep, IFileArtifactRepresentation** outFile)
{
// See if we already have it
- if (auto fileRep = findItem<IFileArtifactRepresentation>(artifact))
+ if (auto fileRep = findRepresentation<IFileArtifactRepresentation>(artifact))
{
fileRep->addRef();
*outFile = fileRep;
@@ -143,7 +139,7 @@ SlangResult ArtifactUtilImpl::requireFileDefaultImpl(IArtifact* artifact, Artifa
IFileArtifactRepresentation* fileRep = new FileArtifactRepresentation(IFileArtifactRepresentation::Kind::Owned, path, lockFile, nullptr);
if (canKeep(keep))
{
- artifact->addItem(fileRep);
+ artifact->addRepresentation(fileRep);
}
// Return it