================ @@ -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}}; ---------------- farzonl wrote:
What if we had a `BuiltinsSPIRVCore.td` `BuiltinsSPIRVVK.td` and a `BuiltinsSPIRVCL.td` The stuff shared between CL and VK could live in Core and the VK and CL builtins will include the Core one. That should let us have seperate `SPIRVTargetInfo` and `SPIRV64TargetInfo`/`SPIRV32TargetInfo`. You won't have an unknown builtin if we do it this way because we would never expose the builtins that aren't valid for the target. https://github.com/llvm/llvm-project/pull/137805 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits