[clang] [clang][SPIRV] Add builtin for OpGenericCastToPtrExplicit and its SPIR-V friendly binding (PR #137805)

Victor Lomuller via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 29 06:49:39 PDT 2025


================
@@ -35,8 +35,10 @@ static constexpr Builtin::Info BuiltinInfos[] = {
 static_assert(std::size(BuiltinInfos) == NumBuiltins);
 
 llvm::SmallVector<Builtin::InfosShard>
-SPIRVTargetInfo::getTargetBuiltins() const {
-  return {{&BuiltinStrings, BuiltinInfos}};
+BaseSPIRTargetInfo::getTargetBuiltins() const {
+  if (getTriple().isSPIRV())
+    return {{&BuiltinStrings, BuiltinInfos}};
----------------
Naghasan wrote:

Oh, that's a left over of my initial prototype in intel/llvm sorry. For historical reasons `spir` / `spir64` is also used there, so had to hack a bit to allow proper testing there. The change should be moving it to `BaseSPIRVTargetInfo` to only enable `spirv`, `spirv32` and `spirv64`. I updated the PR.

https://github.com/llvm/llvm-project/pull/137805


More information about the cfe-commits mailing list