From: Dmitry Sidorov Date: Fri, 21 Apr 2023 22:02:48 +0000 (+0200) Subject: [PATCH 37/79] [NFC] Use typed pointers for null function pointers debug info (#1969) X-Git-Tag: archive/raspbian/15.0.1-1+rpi1^2^2~48 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=13e62dc9f67065fc105a1a69b54d2342d3ba11f4;p=spirv-llvm-translator-15.git [PATCH 37/79] [NFC] Use typed pointers for null function pointers debug info (#1969) `PointerType::get(Context` will return typeless/opaque pointer. While it is OK for KHR translator since it's being built on top of LLVM trunk, where opaque pointers are enabled by default - it won't work for intel/llvm, where their generation is disabled. Upstream of https://github.com/intel/llvm/pull/9118 Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0037-NFC-Use-typed-pointers-for-null-function-pointers-de.patch --- diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp index 7ff8b9a..49f1cfb 100644 --- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp +++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp @@ -1027,8 +1027,8 @@ LLVMToSPIRVDbgTran::transDbgTemplateParameter(const DITemplateParameter *TP) { Constant *C = cast(TVVal)->getValue(); Ops[ValueIdx] = SPIRVWriter->transValue(C, nullptr)->getId(); } else { - SPIRVType *TyPtr = - SPIRVWriter->transType(PointerType::get(M->getContext(), 0)); + SPIRVType *TyPtr = SPIRVWriter->transType( + PointerType::get(Type::getInt8Ty(M->getContext()), 0)); Ops[ValueIdx] = BM->addNullConstant(TyPtr)->getId(); } }