Refactor AsmPrinterHandler callbacks. NFCI.
authorJames Y Knight <jyknight@google.com>
Tue, 22 Nov 2022 18:35:43 +0000 (13:35 -0500)
committerJames Y Knight <jyknight@google.com>
Tue, 22 Nov 2022 23:25:22 +0000 (18:25 -0500)
commit4af73d7ebb5bf4bc2045d15ae0f4ebce56f2d86f
tree05495ff698cd9c4a0a3b2ebb2a217174eaa27f6e
parentcacd3e73d7f87ef3593443271ab3f170d0360934
Refactor AsmPrinterHandler callbacks. NFCI.

The existing behaviors and callbacks were overlapping and had very
confusing semantics: beginBasicBlock/endBasicBlock were not always
called, beginFragment/endFragment seemed like they were meant to mean
the same thing, but were slightly different, etc. This resulted in
confusing semantics, virtual method overloads, and control flow.

Remove the above, and replace with new beginBasicBlockSection and
endBasicBlockSection callbacks. And document them.

These are always called before the first and after the last blocks in
a function, even when basic-block-sections are disabled.
llvm/include/llvm/CodeGen/AsmPrinterHandler.h
llvm/include/llvm/CodeGen/DebugHandlerBase.h
llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfException.h