[PATCH] D146777: [clang] Preliminary fat-lto-object support
Paul Kirth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 21 16:44:09 PDT 2023
paulkirth added inline comments.
================
Comment at: clang/include/clang/Driver/Options.td:2311
MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
+defm fat_lto_objects : BoolFOption<"fat-lto-objects",
+ CodeGenOpts<"FatLTO">, DefaultFalse,
----------------
MaskRay wrote:
> We just need the pos flag for CC1Option, so use `OptInCC1FFlag`
Wouldn't that prevent me from setting `CodeGenOpts<"FatLTO">`? AFAICT `OptInCC1Flag` doesn't take a `CodeGenOpts` since it isn't an `OptionsFlag`.
================
Comment at: clang/test/CodeGen/embed-lto-fatlto.c:8
+/// Check that the ThinLTO metadata is only set false for full LTO
+// FULL: !{{[0-9]+}} = !{i32 1, !"ThinLTO", i32 0}
+// THIN-NOT: !{{[0-9]+}} = !{i32 1, !"ThinLTO", i32 0}
----------------
MaskRay wrote:
>
Extremely useful to know. Not sure how I've missed that until now. Thanks!
================
Comment at: clang/test/Driver/fatlto-objects.c:7
+
+// RUN: %clang --target=x86_64-unknown-linux-gnu -ffat-lto-objects -fintegrated-as -### %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC-NOLTO
+// CHECK-CC-NOLTO: -cc1
----------------
MaskRay wrote:
> You may test that `-ffat-lto-objects` in the absence of `-flto=` gives a `warning: argument unused during compilation: '-ffat-lto-objects'` warning
Since I've slightly refactored the driver code based on your comments, we shouldn't get that warning anymore. I've tested that instead, but we can also drop it, since I'm not sure how much value that adds.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146777/new/
https://reviews.llvm.org/D146777
More information about the cfe-commits
mailing list