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

Xiangling Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 12:09:22 PDT 2020


Xiangling_L added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2167
+  // XTY_ER property anyway.
+  if (TM.getFunctionSections() && !Func->isDeclaration() &&
+      isa<Function>(Func)) {
----------------
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.


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

https://reviews.llvm.org/D83875





More information about the llvm-commits mailing list