bool OutermostLoad = true;
Value *Storage = DVI->getVariableLocationOp(0);
Value *OriginalStorage = Storage;
- while (auto *Inst = dyn_cast<Instruction>(Storage)) {
+ while (auto *Inst = dyn_cast_or_null<Instruction>(Storage)) {
if (auto *LdInst = dyn_cast<LoadInst>(Inst)) {
Storage = LdInst->getOperand(0);
// FIXME: This is a heuristic that works around the fact that
Expr = DIExpression::appendOpsToArg(Expr, Ops, 0, /*StackValue*/ false);
}
}
+ if (!Storage)
+ return;
// Store a pointer to the coroutine frame object in an alloca so it
// is available throughout the function when producing unoptimized
call void @llvm.dbg.declare(metadata i32 %direct, metadata !25, metadata !13), !dbg !14
call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
call void @llvm.dbg.declare(metadata i8** %coro_hdl, metadata !15, metadata !13), !dbg !16
- call void @llvm.dbg.declare(metadata i8* null, metadata !28, metadata !13), !dbg !16
call void @llvm.dbg.declare(metadata i32* %late_local, metadata !29, metadata !13), !dbg !16
+ ; don't crash when encountering nonsensical debug info, verfifier doesn't yet reject these
+ call void @llvm.dbg.declare(metadata i8* null, metadata !28, metadata !13), !dbg !16
+ call void @llvm.dbg.declare(metadata !{}, metadata !28, metadata !13), !dbg !16
br label %next, !dbg !18
next: