[PATCH] D72989: [AIX] Replace EmitFunctionDescriptor with EmitFunctionEntryLabel() and delete needsFunctionDescriptors()

Xiangling Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 07:22:12 PST 2020


Xiangling_L added a comment.

Thank you for mentioning this issue, the reason why we added `MAI->needsFunctionDescriptors()` are as follows:

1. On AIX, function descriptor and function entry point are totally two different things, we are emitting two distinct symbols. Function descriptor symbol has no relation to function entry point symbol other than referencing its address. The way ELFV1 ABI handles descriptors(with the entry point being a local symbol, and the descriptor being the global symbol) it kinda squeaks into the definition of `EmitFunctionEntryLabel()`.

2. From the description of the MCAsmInfo class:



> This class is intended to be used as a base class for asm properties and features specific to the target.

Adding a hook to MAI for descriptors and querying that is a valid way to represent this. That said, there are other places in this file that change the codegen based on explicit check of either the OS or the binary format. Besides, why we prefer the way my previous patch is doing is also because `needsFunctionDescriptors()` makes the code self-documenting as opposed to getTargetTriple().isOSAIX().


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72989





More information about the llvm-commits mailing list