This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][OpenCL] Address post-commit review of D49930
ClosedPublic

Authored by scott.linder on Jul 31 2018, 12:43 PM.

Details

Summary

Refactor collection of member debug info into helper functions and add separate debug-info tests.

The reason for -debug-info-kind=limited in the tests is because they invoke cc1. I am just following the existing tests, but I can change this to just clang with -g.

Diff Detail

Repository
rL LLVM

Event Timeline

scott.linder created this revision.Jul 31 2018, 12:43 PM

Add comments to explain OpenCL case

Looks pretty good. Could you pass CGM in and just make the functions static I couldn't see any other class variables, but might have missed something. One inline comment as well.

-eric

lib/CodeGen/CGDebugInfo.cpp
997 ↗(On Diff #158532)

Just noticed that LineNo is 0... for the entire function.

When I went to mark these as static I noticed they use CGDebugInfo::CreateMemberType which uses a couple other non-static member functions, and it starts to become difficult to tease things out into nice clean static functions.

lib/CodeGen/CGDebugInfo.cpp
997 ↗(On Diff #158532)

What should it be instead? My understanding is that LineNo=0 indicates there is no corresponding source, and these fields seem to be implementation details.

When I went to mark these as static I noticed they use CGDebugInfo::CreateMemberType which uses a couple other non-static member functions, and it starts to become difficult to tease things out into nice clean static functions.

Ah. Fair. No worries then.

lib/CodeGen/CGDebugInfo.cpp
997 ↗(On Diff #158532)

Could probably just replace it with a constant 0 in the calls rather than having the local?

scott.linder added inline comments.Aug 6 2018, 11:26 AM
lib/CodeGen/CGDebugInfo.cpp
997 ↗(On Diff #158532)

Oh, I see what you mean; I will make that change, and I am also working out how to enable ASan correctly to check the patch, then I will post a new diff.

Address feedback

echristo accepted this revision.Aug 7 2018, 10:10 PM

LGTM. Thanks.

This revision is now accepted and ready to land.Aug 7 2018, 10:10 PM
This revision was automatically updated to reflect the committed changes.