Skip to content

Commit f35973f

Browse files
Fix an issue with casting types in debig-info extension implementation
1 parent 4cd4e8e commit f35973f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVEmitNonSemanticDI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ bool SPIRVEmitNonSemanticDI::emitGlobalDI(MachineFunction &MF) {
330330
// If the Pointer is representing a void type it's getBaseType
331331
// is a nullptr
332332
const auto *MaybeNestedBasicType =
333-
cast_or_null<DIBasicType>(PointerDerivedType->getBaseType());
333+
dyn_cast_or_null<DIBasicType>(PointerDerivedType->getBaseType());
334334
if (MaybeNestedBasicType) {
335335
for (const auto &BasicTypeRegPair : BasicTypeRegPairs) {
336336
const auto &[DefinedBasicType, BasicTypeReg] = BasicTypeRegPair;

llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@
8181

8282
; CHECK-OPTION-NOT: DebugTypePointer
8383

84-
%struct_wrapper = type { i32 }
85-
8684
@gi0 = dso_local addrspace(1) global ptr addrspace(4) null, align 4, !dbg !0
8785
@gv0 = dso_local addrspace(1) global ptr addrspace(4) null, align 4, !dbg !5
8886

0 commit comments

Comments
 (0)