================
@@ -4562,7 +4565,15 @@ void Driver::BuildDefaultActions(Compilation &C,
DerivedArgList &Args,
LA->propagateHostOffloadInfo(C.getActiveOffloadKinds(),
/*BoundArch=*/nullptr);
} else {
- LA = C.MakeAction<LinkJobAction>(LinkerInputs, types::TY_Image);
+ // If we are linking but were passed -emit-llvm, we will be calling
+ // llvm-link, so set the output type accordingly. This is only allowed in
+ // rare cases, so make sure we aren't going to error about it.
+ bool LinkingIR = Args.hasArg(options::OPT_emit_llvm) &&
----------------
sarnex wrote:
That's correct, this change is only intended to make functional changes for
`SPIR-V`. However, there is an existing option `-hip-link` that also uses
`llvm-link` (see
[here](https://github.com/sarnex/llvm-project/blob/4cffff5b05823d4530fd0716d10e25b29f6a6cf3/clang/lib/Driver/Driver.cpp#L4237C45-L4238C45))
for the AMDGPU toolchain, so I included that because it's another known case
where we're linking IR.
https://github.com/llvm/llvm-project/pull/169572
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits