[LinkerWrapper] Emit assembly files from LTO with `save-temps`
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 11 Jan 2023 20:57:39 +0000 (14:57 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Thu, 12 Jan 2023 18:54:53 +0000 (12:54 -0600)
commit9e239fc487d51d6b90ad50f6ffa72203d8df3210
treec405cb01ef6398a1210726acea4977664f1afcc3
parent150595ab4be34e392e345d347dcb767df04a5383
[LinkerWrapper] Emit assembly files from LTO with `save-temps`

Currently in LTO mode we don't emit any `.s` files for non-NVPTX targets
during LTO. This makes it diffcult to investigate any failures in the
assembly. This patch makes the save-temps mode output an assembly file
and then assembles it separately. I decided to simply invoke `clang` for
this as it would be a lot of effort to invoke the `MCStramer` interface
directly.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D141543
clang/test/Driver/linker-wrapper.c
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp