[PATCH] D72347: [NFC][XCOFF] Refactor Csect creation into TargetLoweringObjectFile

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 07:16:52 PST 2020


jasonliu added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h:251
+  MCSection *
+  getSectionForExternalReference(const GlobalObject *GO,
+                                 const TargetMachine &TM) const override;
----------------
daltenty wrote:
> DiggerLin wrote:
> > I think we can 
> >  getSectionForExternalReference(const MCSymbol *Sym). const override  here ?
> > 
> > I search all the place where invoke getSectionForExternalReference , it can use the function define  getSectionForExternalReference(const MCSymbol *Sym)
> > 
> > the benefit of using  getSectionForExternalReference(const MCSymbol *Sym) , we save one parameter and have some function parameter as getSectionForFunctionDescriptor  and getSectionForTOCEntry
> I was original inclined to do this as well, but we need to query the GlobalObject to determine whether it is a function, so we can set the correct Storage Mapping Class.
Have we thought about passing an extra bool parameter to indicate whether it is a function or not? I don't like bool parameter either, but in this case, it might not be that bad, and we could avoid querying if we need to create a new name. 


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