[PATCH] D106915: Add a DIExpression const-folder to prevent silly expressions
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 30 11:14:46 PDT 2021
aprantl added a comment.
> Looking at the rest of the infrastructure, I think the Constant is not optional, the DIExpression is the optional part. Most of the time there isn't an expression at all, of course, just the initial operand (which might or might not be a Constant). I suppose that could be redesigned but I think it goes beyond the scope of this patch.
I see, while we use DW_OP_const for DIGlobalVariableExpression(), there is no canonical way to express a llvm.dbg.value that doesn't bind an SSA value. llvm.dbg.value(undef) has a special meaning, and llvm.dbg.value(null) is treated like undef.
================
Comment at: llvm/test/DebugInfo/X86/convert-linked.ll:22
call void @llvm.dbg.value(metadata i8 %x, metadata !13, metadata !DIExpression()), !dbg !14
- call void @llvm.dbg.value(metadata i8 32, metadata !15, metadata !DIExpression(DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !17
+ call void @llvm.dbg.value(metadata i8 32, metadata !15, metadata !DIExpression(DW_OP_deref, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !17
ret i8 %x, !dbg !18
----------------
This looks wrong: What is a DW_OP_deref of the constant 32 supposed to be?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106915/new/
https://reviews.llvm.org/D106915
More information about the llvm-commits
mailing list