This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Add test cases for FlagNonTrivial
ClosedPublic

Authored by asmith on Mar 5 2019, 6:59 PM.

Details

Summary

This is a test case to go with D44406 which added FlagNonTrivial to mark that a C++ record is non-trivial to support CodeView debug emission.

While it looks like FlagTypePassByValue can imply triviality and FlagTypePassByReference can imply non-triviality that is not true. Some non-trivial cases use a combination of FlagNonTrivial and FlagTypePassByValue instead of FlagTypePassByReference. See the test cases and D44406 for discussion.

Diff Detail

Repository
rC Clang

Event Timeline

asmith created this revision.Mar 5 2019, 6:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2019, 6:59 PM

Mind adding at least one example with neither triviality flag? (I guess a type that's not a struct or class? A union maybe?)

(in some ways this test is retesting some of the triviality that's already tested by other parts of the compiler that relies on triviality properties - so I'm ambivalent about testing /all/ these combinations (for instance, I'd probably not both testing any cases related to access modifiers at least - public/private doesn't have any effect on triviality, right? (so I'd leave all the tests public/struct))

test/CodeGenCXX/debug-info-composite-triviality.cpp
5–6

Would it be sufficient for this function to just be:

void Func(T&) {}

Since C++ supports overloading, there shouldn't be a need to mangle the type name into the function name manually, and any reference to the type should be enough for it to be emitted.

asmith updated this revision to Diff 189592.Mar 6 2019, 2:14 PM

Any additional comments on the tests?

dblaikie accepted this revision.Mar 11 2019, 5:39 PM

Looks good - thanks!

This revision is now accepted and ready to land.Mar 11 2019, 5:39 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2019, 6:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript