commit: 7b17991c991400e52f2d085b4f469834446c465a
Author: Mazunki Hoksaas <rolferen <AT> gmail <DOT> com>
AuthorDate: Sat Mar 9 03:00:54 2024 +0000
Commit: Mazunki Hoksaas <rolferen <AT> gmail <DOT> com>
CommitDate: Sat Mar 9 03:00:54 2024 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7b17991c
dev-util/DirectXShaderCompiler: fix #905173
Signed-off-by: Mazunki Hoksaas <rolferen <AT> gmail.com>
...ld => DirectXShaderCompiler-1.7.2212-r1.ebuild} | 3 +
...aderCompiler-1.7.2212-fix-changes-meaning.patch | 148 +++++++++++++++++++++
2 files changed, 151 insertions(+)
diff --git
a/dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212.ebuild
b/dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212-r1.ebuild
similarity index 97%
rename from dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212.ebuild
rename to
dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212-r1.ebuild
index ca618c1d4d..42f1100fa0 100644
--- a/dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212.ebuild
+++ b/dev-util/DirectXShaderCompiler/DirectXShaderCompiler-1.7.2212-r1.ebuild
@@ -36,6 +36,9 @@ CHECKREQS_MEMORY="4G"
CHECKREQS_DISK_BUILD="4G"
CMAKE_EXTRA_CACHE_FILE="${S}/cmake/caches/PredefinedParams.cmake"
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-changes-meaning.patch # bgo #905173
+)
src_prepare() {
rm -d "${S}"/external/SPIRV* || die
rm -d "${S}"/external/DirectX* || die
diff --git
a/dev-util/DirectXShaderCompiler/files/DirectXShaderCompiler-1.7.2212-fix-changes-meaning.patch
b/dev-util/DirectXShaderCompiler/files/DirectXShaderCompiler-1.7.2212-fix-changes-meaning.patch
new file mode 100644
index 0000000000..f1523bf608
--- /dev/null
+++
b/dev-util/DirectXShaderCompiler/files/DirectXShaderCompiler-1.7.2212-fix-changes-meaning.patch
@@ -0,0 +1,148 @@
+diff --git a/include/llvm/Analysis/DxilValueCache.h
b/include/llvm/Analysis/DxilValueCache.h
+index 2622bb19..37124255 100644
+--- a/include/llvm/Analysis/DxilValueCache.h
++++ b/include/llvm/Analysis/DxilValueCache.h
+@@ -52,7 +52,7 @@ struct DxilValueCache : public ImmutablePass {
+
+ private:
+
+- WeakValueMap ValueMap;
++ WeakValueMap Map;
+ bool (*ShouldSkipCallback)(Value *V) = nullptr;
+
+ void MarkUnreachable(BasicBlock *BB);
+@@ -77,8 +77,8 @@ public:
+ Value *GetValue(Value *V, DominatorTree *DT=nullptr);
+ Constant *GetConstValue(Value *V, DominatorTree *DT = nullptr);
+ ConstantInt *GetConstInt(Value *V, DominatorTree *DT = nullptr);
+- void ResetUnknowns() { ValueMap.ResetUnknowns(); }
+- void ResetAll() { ValueMap.ResetAll(); }
++ void ResetUnknowns() { Map.ResetUnknowns(); }
++ void ResetAll() { Map.ResetAll(); }
+ bool IsUnreachable(BasicBlock *BB, DominatorTree *DT=nullptr);
+ void SetShouldSkipCallback(bool (*Callback)(Value *V)) { ShouldSkipCallback
= Callback; };
+ };
+diff --git a/lib/Analysis/DxilValueCache.cpp b/lib/Analysis/DxilValueCache.cpp
+index dbd82a39..f5266927 100644
+--- a/lib/Analysis/DxilValueCache.cpp
++++ b/lib/Analysis/DxilValueCache.cpp
+@@ -57,7 +57,7 @@ bool IsEntryBlock(const BasicBlock *BB) {
+ }
+
+ void DxilValueCache::MarkUnreachable(BasicBlock *BB) {
+- ValueMap.Set(BB, ConstantInt::get(Type::getInt1Ty(BB->getContext()), 0));
++ Map.Set(BB, ConstantInt::get(Type::getInt1Ty(BB->getContext()), 0));
+ }
+
+ bool DxilValueCache::MayBranchTo(BasicBlock *A, BasicBlock *B) {
+@@ -93,7 +93,7 @@ bool DxilValueCache::MayBranchTo(BasicBlock *A, BasicBlock
*B) {
+ }
+
+ bool DxilValueCache::IsUnreachable_(BasicBlock *BB) {
+- if (Value *V = ValueMap.Get(BB))
++ if (Value *V = Map.Get(BB))
+ if (IsConstantFalse(V))
+ return true;
+ return false;
+@@ -155,7 +155,7 @@ Value *DxilValueCache::ProcessAndSimplify_PHI(Instruction
*I, DominatorTree *DT)
+ // that were computed previously.
+ if (!Simplified) {
+ if (SimplifiedNotDominating)
+- if (Value *CachedV = ValueMap.Get(SimplifiedNotDominating))
++ if (Value *CachedV = Map.Get(SimplifiedNotDominating))
+ Simplified = CachedV;
+ }
+
+@@ -379,7 +379,7 @@ Value *DxilValueCache::SimplifyAndCacheResult(Instruction
*I, DominatorTree *DT)
+ }
+
+ if (Simplified && isa<Constant>(Simplified))
+- ValueMap.Set(I, Simplified);
++ Map.Set(I, Simplified);
+
+ return Simplified;
+ }
+@@ -500,7 +500,7 @@ void DxilValueCache::WeakValueMap::Set(Value *Key, Value
*V) {
+ // If there's a cached value, return it. Otherwise, return
+ // the value itself.
+ Value *DxilValueCache::TryGetCachedValue(Value *V) {
+- if (Value *Simplified = ValueMap.Get(V))
++ if (Value *Simplified = Map.Get(V))
+ return Simplified;
+ return V;
+ }
+@@ -516,7 +516,7 @@ StringRef DxilValueCache::getPassName() const {
+ Value *DxilValueCache::GetValue(Value *V, DominatorTree *DT) {
+ if (dyn_cast<Constant>(V))
+ return V;
+- if (Value *NewV = ValueMap.Get(V))
++ if (Value *NewV = Map.Get(V))
+ return NewV;
+
+ return ProcessValue(V, DT);
+@@ -541,7 +541,7 @@ bool DxilValueCache::IsUnreachable(BasicBlock *BB,
DominatorTree *DT) {
+
+ LLVM_DUMP_METHOD
+ void DxilValueCache::dump() const {
+- ValueMap.dump();
++ Map.dump();
+ }
+
+ void DxilValueCache::getAnalysisUsage(AnalysisUsage &AU) const {
+@@ -580,15 +580,15 @@ Value *DxilValueCache::ProcessValue(Value *NewV,
DominatorTree *DT) {
+
+ // If we haven't seen this value, go in and push things it depends on
+ // into the worklist.
+- if (!ValueMap.Seen(V)) {
+- ValueMap.SetSentinel(V);
++ if (!Map.Seen(V)) {
++ Map.SetSentinel(V);
+ if (Instruction *I = dyn_cast<Instruction>(V)) {
+
+ for (Use &U : I->operands()) {
+ Instruction *UseI = dyn_cast<Instruction>(U.get());
+ if (!UseI)
+ continue;
+- if (!ValueMap.Seen(UseI))
++ if (!Map.Seen(UseI))
+ WorkList.push_back(UseI);
+ }
+
+@@ -596,9 +596,9 @@ Value *DxilValueCache::ProcessValue(Value *NewV,
DominatorTree *DT) {
+ for (unsigned i = 0; i < PN->getNumIncomingValues(); i++) {
+ BasicBlock *BB = PN->getIncomingBlock(i);
+ TerminatorInst *Term = BB->getTerminator();
+- if (!ValueMap.Seen(Term))
++ if (!Map.Seen(Term))
+ WorkList.push_back(Term);
+- if (!ValueMap.Seen(BB))
++ if (!Map.Seen(BB))
+ WorkList.push_back(BB);
+ }
+ }
+@@ -607,9 +607,9 @@ Value *DxilValueCache::ProcessValue(Value *NewV,
DominatorTree *DT) {
+ for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E;
PI++) {
+ BasicBlock *PredBB = *PI;
+ TerminatorInst *Term = PredBB->getTerminator();
+- if (!ValueMap.Seen(Term))
++ if (!Map.Seen(Term))
+ WorkList.push_back(Term);
+- if (!ValueMap.Seen(PredBB))
++ if (!Map.Seen(PredBB))
+ WorkList.push_back(PredBB);
+ }
+ }
+diff --git a/tools/clang/include/clang/Basic/Version.h
b/tools/clang/include/clang/Basic/Version.h
+index d3a3b4f4..19fa889c 100644
+--- a/tools/clang/include/clang/Basic/Version.h
++++ b/tools/clang/include/clang/Basic/Version.h
+@@ -18,7 +18,8 @@
+
+ #include "clang/Basic/Version.inc"
+ #include "llvm/ADT/StringRef.h"
+-
++// HLSL Change - for uint32_t.
++#include <cstdint>
+ /// \brief Helper macro for CLANG_VERSION_STRING.
+ #define CLANG_MAKE_VERSION_STRING2(X) #X
+