[PATCH] D132708: [MC] Emit Stackmaps before debug info

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 16:10:48 PDT 2022


zero9178 added a comment.

In D132708#3773282 <https://reviews.llvm.org/D132708#3773282>, @lhames wrote:

>> The current approach of special casing for the __LLVM_STACKMAPS section is not viable either, as downstream users can overwrite the stackmap format using plugins, which may want to use different sections.
>
> @zero9178 Could you elaborate on this? Was `__LLVM_STACKMAPS` handling being special cased in assertions in LLVM, or in tools that consumed MachO?
>
> What do you mean by "downstream users can overwrite the stackmap format using plugins"? When do those plugins run, and how would they interfere with the special casing?
>
> I don't mind this approach, but am curious about the design constraints on stack maps and how they're being used at the moment.

With the special case I was simply referring to the assertion. 
These plugins I was referring to are the `GCMetaDataPrinter` defined here https://github.com/llvm/llvm-project/blob/f049b2c3fcbae739ac965f97fd6855ca1aab77b8/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
The `emitStackmaps` function that was moved here calls any implementations in the registry to write out the stackmap [0]. The default stackmap is only used if a `GCMetaDataPrinter` does not emit a stackmap.
Since users of the `GCMetaDataPrinter` can use the `AsmPrinter` arbitrarly and can choose not to use the `__LLVMSTACKMAP` section it would then lead to the assertion being triggered.

[0] https://github.com/llvm/llvm-project/blob/f049b2c3fcbae739ac965f97fd6855ca1aab77b8/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L3765


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132708/new/

https://reviews.llvm.org/D132708



More information about the llvm-commits mailing list