This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Reproducers] Simplify LLDB_RECORD macros
ClosedPublic

Authored by JDevlieghere on Apr 14 2020, 12:08 PM.

Details

Summary

Redefine the LLDB_RECORD macros in terms of a common uber-macro to reduce code duplication across them.

Diff Detail

Event Timeline

JDevlieghere created this revision.Apr 14 2020, 12:08 PM

Add a comment

This looks even better than I hoped. I think this is a worthwhile simplification even without the followup patches. Just a couple of questions inline...

lldb/include/lldb/Utility/ReproducerInstrumentation.h
117–135

Could you merge these two in a similar way as well (not with the method macros, just with themselves)? I know that the constructors could be implemented as a function in the other patch, but I have a feeling it will be pretty confusing if two very similar functionalities were implemented in completely different ways...

137

idea: Should we standardize the name of the inner class and drop the Method argument?

757–760

Why the void overload? It looks like the templated version would work just fine for void too...

JDevlieghere marked 3 inline comments as done.

Address Pavel's code review feedback

labath accepted this revision.Apr 16 2020, 12:24 AM

Very nice.

This revision is now accepted and ready to land.Apr 16 2020, 12:24 AM
This revision was automatically updated to reflect the committed changes.