This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Refactor DbgInfoIntrinsic class hierarchy.
ClosedPublic

Authored by HsiangKai on Aug 2 2018, 8:41 PM.

Details

Summary

In the past, DbgInfoIntrinsic has a strong assumption that these
intrinsics all have variables and expressions attached to them.
However, it is too strong to derive the class for other debug entities.
Now, it has problems for debug labels.

In order to make DbgInfoIntrinsic as a base class for 'debug info', I
create a class for 'variable debug info', DbgVariableIntrinsic.

DbgDeclareInst, DbgAddrIntrinsic, and DbgValueInst will be derived from it.

Diff Detail

Repository
rL LLVM

Event Timeline

HsiangKai created this revision.Aug 2 2018, 8:41 PM
aprantl accepted this revision.Aug 3 2018, 8:20 AM

I think this is reasonable. Let's maybe give this another day to see if anyone sees a problem with this before landing it.

This revision is now accepted and ready to land.Aug 3 2018, 8:20 AM

Two totally optional style nits. The new class distinction seems like an improvement.

include/llvm/IR/InstVisitor.h
215

Nit: I'd prefer the braces here to line up with the braces for the following Dbg intrinsics.

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
5179

This could be const auto &DI.

HsiangKai updated this revision to Diff 159176.Aug 4 2018, 3:03 AM

Revert rL336176. After refactoring DbgInfoIntrinsic, there is no need to check if it is DbgLabelInst or not in getVariableLocation().

HsiangKai updated this revision to Diff 159177.Aug 4 2018, 3:14 AM
HsiangKai marked 2 inline comments as done.
HsiangKai added inline comments.Aug 4 2018, 3:19 AM
lib/IR/IntrinsicInst.cpp
52

Revert rL336176 here.

This revision was automatically updated to reflect the committed changes.