This potentially has a slightly positive performance impact, as
std::visit can be implemented as a switch-like jump rather than
a series of ifs.
More importantly, the reader can be confident is no overlap between the
cases.
Paths
| Differential D158678
[NFC][AsmPrinter] Use std::visit in constructVariableDIEImpl ClosedPublic Authored by scott.linder on Aug 23 2023, 3:41 PM.
Details
Summary This potentially has a slightly positive performance impact, as More importantly, the reader can be confident is no overlap between the
Diff Detail
Event Timelinescott.linder added a parent revision: D158677: [NFC][AsmPrinter] Expose std::variant-ness of DbgVariable.Aug 23 2023, 3:42 PM fdeazeve added inline comments.
This revision is now accepted and ready to land.Aug 25 2023, 11:13 AM
This revision was landed with ongoing or failed builds.Sep 11 2023, 10:33 AM Closed by commit rG433314619549: [NFC][AsmPrinter] Use std::visit in constructVariableDIEImpl (authored by scott.linder). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 552909 llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
|
What do you think of implementing each of the visitors as a private member of DwarfCompileUnit?
I personally think this function could benefit from being split into different functions for readability, but this is a larger refactor.