[PATCH] D72347: [NFC][XCOFF] Refactor Csect creation into TargetLoweringObjectFile
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 17 08:34:36 PST 2020
hubert.reinterpretcast added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h:247
+
+ MCSection *getSectionForFunctionDescriptor(const MCSymbol *) const override;
+ MCSection *getSectionForTOCEntry(const MCSymbol *Sym) const override;
----------------
I am not sure there is anything about this interface that indicates that it is not suitable for retrieving the section for a function descriptor in the case where said section should be an external reference. In `lowerConstant`, the argument value needed to call this function is available even in the case where the function is undefined.
================
Comment at: llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h:250
+ MCSection *
+ getSectionForExternalReference(const GlobalObject *GO,
+ const TargetMachine &TM) const override;
----------------
I am not sure there is anything about this interface that indicates that it is not suitable for retrieving the section for an external reference to a function entry point. Where `getAIXFuncEntryPointSymbolSDNode` is present in the codebase, the function is also handled as a `GlobalObject`.
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1837
+ const GlobalObject *GO, const TargetMachine &TM) const {
+ assert(GO->isDeclaration() && "Tried to get ER section for defined global.");
+
----------------
Add "a" before "defined global".
================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1806
+ return;
+
if ((!GVKind.isCommon() && !GVKind.isBSS() && !GVKind.isData() &&
----------------
Assert `!GV->isDeclaration()` here to be sure that `GVKind` has been initialized.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72347/new/
https://reviews.llvm.org/D72347
More information about the llvm-commits
mailing list