summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-artifact-util.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-12 12:06:41 -0400
committerGitHub <noreply@github.com>2023-04-12 12:06:41 -0400
commiteda9dd33647b271dd5ea5256e87cb23ad269b19f (patch)
treefb869c983b5eda00794606caeb6334ac176d359a /source/compiler-core/slang-artifact-util.cpp
parent4e9ca28a71dca90e19a15b2103bdc3d0db6ffd9c (diff)
Artifact Container (#2783)
* #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.
Diffstat (limited to 'source/compiler-core/slang-artifact-util.cpp')
-rw-r--r--source/compiler-core/slang-artifact-util.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/compiler-core/slang-artifact-util.cpp b/source/compiler-core/slang-artifact-util.cpp
index 1a920ff18..00884c96f 100644
--- a/source/compiler-core/slang-artifact-util.cpp
+++ b/source/compiler-core/slang-artifact-util.cpp
@@ -47,12 +47,13 @@ static bool _checkRecursive(ArtifactUtil::FindStyle findStyle)
return createArtifact(desc);
}
-/* static */bool ArtifactUtil::isSignificant(IArtifact* artifact, void* data)
+/* static */bool ArtifactUtil::isSignificant(IArtifact* artifact)
{
- SLANG_UNUSED(data);
-
- const auto desc = artifact->getDesc();
+ return isSignificant(artifact->getDesc());
+}
+/* static */bool ArtifactUtil::isSignificant(const ArtifactDesc& desc)
+{
// Containers are not significant as of themselves, they may contain something tho
if (isDerivedFrom(desc.kind, ArtifactKind::Container))
{
@@ -85,6 +86,13 @@ static bool _checkRecursive(ArtifactUtil::FindStyle findStyle)
return true;
}
+
+/* static */bool ArtifactUtil::isSignificant(IArtifact* artifact, void* data)
+{
+ SLANG_UNUSED(data);
+ return isSignificant(artifact->getDesc());
+}
+
/* static */IArtifact* ArtifactUtil::findSignificant(IArtifact* artifact)
{
return findArtifactByPredicate(artifact, FindStyle::SelfOrChildren, &ArtifactUtil::isSignificant, nullptr);