[PATCH] D76162: [AIX] discard the label in the csect of function description and use qualname for linkage

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 15:39:51 PDT 2020


DiggerLin marked 6 inline comments as done.
DiggerLin added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1974
+  SmallString<128> NameStr;
+  getMangler().getNameWithPrefix(NameStr, F, /*CannotUsePrivateLabel=*/false);
+  return getContext().getXCOFFSection(
----------------
jasonliu wrote:
> Looking at what other XCOFF function is doing in this file, I think we should be consistent with them for easier maintenance which means we should call
> 
> ```
> getNameWithPrefix(Name, GO, TM);
> ```
> instead. 
TM is not a member of TargetLoweringObjectFile, do you want pass TM as parameter of getSectionForFunctionDescriptor() ? I do not think we need a TM as parameter of   getSectionForFunctionDescriptor.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1976
+  return getContext().getXCOFFSection(
+      NameStr.str(), XCOFF::XMC_DS, XCOFF::XTY_SD, getStorageClassForGlobal(F),
+      SectionKind::getData());
----------------
jasonliu wrote:
> NameStr is good. I don't think you need to call .str().
thanks, there is function operator StringRef() const { return str(); }


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1740
+               getObjFileLowering().getSectionForFunctionDescriptor(
+                   dyn_cast<const Function>(GO)))
         ->getQualNameSymbol();
----------------
jasonliu wrote:
> Why do we use dyn_cast? Is there a chance GO is not a Function when we gets here?
getSectionForFunctionDescriptor(Function*) , but GO is GlobalObject.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76162





More information about the llvm-commits mailing list