[PATCH] D150930: [Driver] Accept and ignore -fno-lifetime-dse argument

Sam James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 19:58:38 PDT 2023


thesamesam created this revision.
thesamesam added reviewers: MaskRay, jhuber6, tstellar.
Herald added a project: All.
thesamesam requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Since 47f5c54f997a59bb2c65abe6b8b811f6e7553456 <https://reviews.llvm.org/rG47f5c54f997a59bb2c65abe6b8b811f6e7553456>, we pass -fno-lifetime-dse
when building LLVM with GCC.

Unfortunately, this impacts projects which build LLVM using GCC who then try
to use e.g. clang-tidy because of the flag leaking into compile_commands.json.

While we're trying to stop adding these, given we're passing the flag ourselves,
I don't think we have much of a choice here.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150930

Files:
  clang/include/clang/Driver/Options.td


Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -4940,6 +4940,7 @@
 defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
+defm fno_lifetime_dse : BooleanFFlag<"lifetime-dse">, IgnoredGCCCompat;
 defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
 defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;
 defm gcse : BooleanFFlag<"gcse">, Group<clang_ignored_gcc_optimization_f_Group>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150930.523641.patch
Type: text/x-patch
Size: 868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230519/10011543/attachment.bin>


More information about the cfe-commits mailing list