[PATCH] D55227: [DebugInfo] Don't drop dbg.value's of nullptr
David Stenberg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 4 00:18:03 PST 2018
dstenb added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5305
+ if (isa<ConstantInt>(V) || isa<ConstantFP>(V) || isa<UndefValue>(V) ||
+ isa<ConstantPointerNull>(V)) {
SDV = DAG.getConstantDbgValue(Variable, Expression, V, dl, SDNodeOrder);
----------------
vsk wrote:
> I'm curious what happens if V is-a Constant, but not one of these constants (e.g ConstantAggregate). It seems unlikely that V would always be in NodeMap in that case.
If it is not something that is in NodeMap here, nor resolved later via DanglingDebugInfoMap, then nothing will be emitted, so the preceding dbg value can live longer than expected. There is the following TODO for this:
```
// TODO: When we get here we will either drop the dbg.value completely, or
// we try to move it forward by letting it dangle for awhile. So we should
// probably add an extra DbgValue to the DAG here, with a reference to
// "noreg", to indicate that we have lost the debug location for the
// variable.
```
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55227/new/
https://reviews.llvm.org/D55227
More information about the llvm-commits
mailing list