aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorSean Fertile <35576261+mandlebug@users.noreply.github.com>2024-01-22 21:41:19 -0500
committerGitHub <noreply@github.com>2024-01-22 21:41:19 -0500
commit62eb65b36f8e8fa121de047c89fb7dbe5d4c96be (patch)
tree064d2d5091e905652e25e6b2e514bbde1fd1b009 /clang/lib/Driver/Driver.cpp
parent9577806b1e6ce06bece48d96b39035f4cee9137d (diff)
downloadllvm-62eb65b36f8e8fa121de047c89fb7dbe5d4c96be.zip
llvm-62eb65b36f8e8fa121de047c89fb7dbe5d4c96be.tar.gz
llvm-62eb65b36f8e8fa121de047c89fb7dbe5d4c96be.tar.bz2
[FatLTO] output of -ffat-lto-objects -S should be assembly. (#79041)
Fat lto with -c compiles to an object file with the IR embedded in a section of the object, the combination of fat-lto with -S should then produce an assembly file equivalent of that. The IR output can still be genreated by using both -S and -emit-llvm.
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1c32370..5c17091 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -4770,10 +4770,11 @@ Action *Driver::ConstructPhaseAction(
case phases::Backend: {
if (isUsingLTO() && TargetDeviceOffloadKind == Action::OFK_None) {
types::ID Output;
- if (Args.hasArg(options::OPT_S))
+ if (Args.hasArg(options::OPT_ffat_lto_objects))
+ Output = Args.hasArg(options::OPT_emit_llvm) ? types::TY_LTO_IR
+ : types::TY_PP_Asm;
+ else if (Args.hasArg(options::OPT_S))
Output = types::TY_LTO_IR;
- else if (Args.hasArg(options::OPT_ffat_lto_objects))
- Output = types::TY_PP_Asm;
else
Output = types::TY_LTO_BC;
return C.MakeAction<BackendJobAction>(Input, Output);