[PATCH] D71393: Default to -fuse-init-array

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 10:51:18 PST 2019


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2786-2799
   bool UseInitArrayDefault =
       getTriple().getArch() == llvm::Triple::aarch64 ||
       getTriple().getArch() == llvm::Triple::aarch64_be ||
       (getTriple().isOSFreeBSD() &&
        getTriple().getOSMajorVersion() >= 12) ||
       (getTriple().getOS() == llvm::Triple::Linux &&
        ((!GCCInstallation.isValid() || !V.isOlderThan(4, 7, 0)) ||
----------------
rnk wrote:
> I'd like to consider inverting the default. I suspect for a lot of the cases where this results in defaulting to ctors, we actually want to use init_array. However, that would be a functional change, and therefore out of scope.
The difficult part of "inverting the default" is to figure out the exceptions ;-) I am preparing a patch for that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71393





More information about the cfe-commits mailing list