llvm15/llvm-workaround-superfluous-branches.patch
Aaron Puchert 624dee5c5c - Apply clang-shlib-symbol-versioning.patch to add symbol versions
to libclang-cpp.so similar to libLLVM.so. This is required when
  multiple versions of the library are loaded into the same
  process. (boo#1219405, boo#1221183, boo#1233220)

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=42
2024-11-17 20:09:14 +00:00

15 lines
518 B
Diff

diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h
index b6bbff8..1b68640 100644
--- a/llvm/include/llvm/Support/Casting.h
+++ b/llvm/include/llvm/Support/Casting.h
@@ -605,6 +605,9 @@ LLVM_NODISCARD inline decltype(auto) dyn_cast(From &Val) {
template <typename To, typename From>
LLVM_NODISCARD inline decltype(auto) dyn_cast(From *Val) {
+#if defined(__clang__) && defined(NDEBUG)
+ __builtin_assume(Val);
+#endif
return CastInfo<To, From *>::doCastIfPossible(Val);
}