[PATCH] D88737: [AIX] Turn -fdata-sections on by default in Clang

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 08:34:32 PDT 2020


MaskRay requested changes to this revision.
MaskRay added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/include/clang/Basic/CodeGenOptions.def:47
+CODEGENOPT(DataSections      , 1, 0) ///< Set by default, or when -f[no-]data-sections.
+CODEGENOPT(HasExplicitDataSections, 1, 0) ///< Set when -f[no-]data-sections is set.
 CODEGENOPT(UniqueSectionNames, 1, 1) ///< Set for -funique-section-names.
----------------
>From the current code. I don't see HasExplicitDataSections is necessary. Please remove the lld changes.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4915
+      CmdArgs.push_back("-fno-data-sections");
+  } else if (UseSeparateSections) {
     CmdArgs.push_back("-fdata-sections");
----------------
You can place AIX in isUseSeparateSections instead.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:994
 
+  if (Args.getLastArg(OPT_fdata_sections) ||
+      Args.getLastArg(OPT_fno_data_sections)) {
----------------
In many cases, there is no need for having both positive and negative CC1 options. The driver handles the default.


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

https://reviews.llvm.org/D88737



More information about the cfe-commits mailing list