summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-ast-base.h2
-rw-r--r--source/slang/slang-ast-type.cpp1
-rw-r--r--source/slang/slang-ast-type.h3
-rw-r--r--source/slang/slang-ast-val.h2
-rw-r--r--source/slang/slang-hash-utils.h9
-rw-r--r--source/slang/slang.cpp12
6 files changed, 21 insertions, 8 deletions
diff --git a/source/slang/slang-ast-base.h b/source/slang/slang-ast-base.h
index dea02afbb..04788340a 100644
--- a/source/slang/slang-ast-base.h
+++ b/source/slang/slang-ast-base.h
@@ -9,6 +9,8 @@
#include "slang-serialize-reflection.h"
+#include "../core/slang-digest.h"
+
// This file defines the primary base classes for the hierarchy of
// AST nodes and related objects. For example, this is where the
// basic `Decl`, `Stmt`, `Expr`, `type`, etc. definitions come from.
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp
index 39b7a8e04..480589af4 100644
--- a/source/slang/slang-ast-type.cpp
+++ b/source/slang/slang-ast-type.cpp
@@ -1089,7 +1089,6 @@ Val* AndType::_substituteImplOverride(ASTBuilder* astBuilder, SubstitutionSet su
// ModifiedType
-
void ModifiedType::_toTextOverride(StringBuilder& out)
{
for( auto modifier : modifiers )
diff --git a/source/slang/slang-ast-type.h b/source/slang/slang-ast-type.h
index 5bb91e5da..895b64f35 100644
--- a/source/slang/slang-ast-type.h
+++ b/source/slang/slang-ast-type.h
@@ -26,7 +26,6 @@ class InitializerListType : public Type
{
SLANG_AST_CLASS(InitializerListType)
-
// Overrides should be public so base classes can access
void _toTextOverride(StringBuilder& out);
Type* _createCanonicalTypeOverride();
@@ -694,7 +693,7 @@ class NamespaceType : public Type
void _toTextOverride(StringBuilder& out);
bool _equalsImplOverride(Type* type);
HashCode _getHashCodeOverride();
- Type* _createCanonicalTypeOverride();
+ Type* _createCanonicalTypeOverride();
};
// The concrete type for a value wrapped in an existential, accessible
diff --git a/source/slang/slang-ast-val.h b/source/slang/slang-ast-val.h
index a67d62e3b..49189f65c 100644
--- a/source/slang/slang-ast-val.h
+++ b/source/slang/slang-ast-val.h
@@ -3,6 +3,7 @@
#pragma once
#include "slang-ast-base.h"
+#include "../core/slang-digest.h"
namespace Slang {
@@ -379,7 +380,6 @@ class TaggedUnionSubtypeWitness : public SubtypeWitness
//
List<Val*> caseWitnesses;
-
// Overrides should be public so base classes can access
bool _equalsValOverride(Val* val);
void _toTextOverride(StringBuilder& out);
diff --git a/source/slang/slang-hash-utils.h b/source/slang/slang-hash-utils.h
index 62232dd21..c354e43f0 100644
--- a/source/slang/slang-hash-utils.h
+++ b/source/slang/slang-hash-utils.h
@@ -29,12 +29,13 @@ namespace Slang
{
StringBuilder filename;
- for (Index i = 0; i < 4; ++i)
+ uint8_t* uint8Hash = (uint8_t*)hash.values;
+
+ for (Index i = 0; i < 16; ++i)
{
- auto hashSegmentString = String(hash.values[i], 16);
+ auto hashSegmentString = String(uint8Hash[i], 16);
- auto leadingZeroCount = 8 - hashSegmentString.getLength();
- for (Index j = 0; j < leadingZeroCount; ++j)
+ if (hashSegmentString.getLength() == 1)
{
filename.append("0");
}
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 20cad2465..3fb89c549 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1367,6 +1367,18 @@ void Linkage::updateDependencyBasedHash(
{
builder.addToDigest(capability);
}
+
+ // Add the downstream compiler version (if it exists) to the hash
+ auto passThroughMode = getDownstreamCompilerRequiredForTarget(targetReq->getTarget());
+ auto downstreamCompiler = getSessionImpl()->getOrLoadDownstreamCompiler(passThroughMode, nullptr);
+ if (downstreamCompiler)
+ {
+ ComPtr<ISlangBlob> versionString;
+ if (SLANG_SUCCEEDED(downstreamCompiler->getVersionString(versionString.writeRef())))
+ {
+ builder.addToDigest(versionString);
+ }
+ }
}
SlangResult Linkage::addSearchPath(