[PATCH] D83875: [XCOFF][AIX] Enable -ffunction-sections

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 12:13:54 PDT 2020


DiggerLin added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2167
+  // XTY_ER property anyway.
+  if (TM.getFunctionSections() && !Func->isDeclaration() &&
+      isa<Function>(Func)) {
----------------
Xiangling_L wrote:
> jasonliu wrote:
> > DiggerLin wrote:
> > > change  Func->isDeclaration() to Func->isDeclarationForLinker() ?
> > Sometimes I would get confused myself which query should be used. 
> > As far as I understand, isDelcarationForLinker includes linkage that's "AvailableExternally". But when does it actually matter for a function? In other words, what would go wrong if `isDeclaration()` is used here? 
> AFAIK, this linkage only matters for global variables not for functions.
thanks for clarification. 


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

https://reviews.llvm.org/D83875





More information about the llvm-commits mailing list