This is an archive of the discontinued LLVM Phabricator instance.

[debug-info] As an NFC commit, refactor EmitFuncArgumentDbgValue so that it can be extended to support llvm.dbg.addr.
ClosedPublic

Authored by gottesmm on Apr 1 2022, 4:05 PM.

Details

Summary

The reason why I am making this change is that before this commit,
EmitFuncArgumentDbgValue relied on a boolean flag IsDbgDeclare both to signal
that a DBG_VALUE should be made to be indirect /and/ that the original intrinsic
was a dbg.declare. This is no longer always true if we add support for handling
dbg.addr since we will have an indirect DBG_VALUE that is a different intrinsic
from dbg.declare.

With that in mind, in this NFC patch, we prepare for future fixes by introducing
a 3 case-enum argument to EmitFuncArgumentDbgValue that allows the caller to
explicitly specify how the argument's DBG_VALUE should be emitted. This then
allows us to turn the indirect checks into a != FuncArgumentDbgValueKind::Value
and prepare us for a future where we add support here for llvm.dbg.addr
directly.

rdar://83957028

Diff Detail

Event Timeline

gottesmm created this revision.Apr 1 2022, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 4:05 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
gottesmm requested review of this revision.Apr 1 2022, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 4:05 PM
aprantl accepted this revision.Apr 1 2022, 4:07 PM
aprantl added inline comments.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
614

nit:

Value, ///< This was a llvm.dbg.value.
...
This revision is now accepted and ready to land.Apr 1 2022, 4:07 PM
gottesmm updated this revision to Diff 419883.Apr 1 2022, 4:11 PM

Updated comment as per aprantl's suggestion!

I am going to wait for one of the Debian and or windows builder to pass successfully before merging this.