[lld] [llvm] [LTO][lld] Emit textual assembly code with '--save-temps' (PR #195922)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 19:27:59 PDT 2026


MaskRay wrote:

> Please don't change `ld.lld --save-temps` to emit asm by default. The output is huge and unneeded by most debugging scenarios. You can specify `ld.lld --save-temps=asm`

The title still suggests that the patch will change `--save-temps` to emit asm, which is IMO not acceptable.

> The MC layer is already linked as far as I'm aware, it's just more includes. The issue is that going from IR has two separate options as far as I'm aware. llc exposes --filetype=asm and --filestype=obj. I don't think there's a way to do a 'drive-by' and get assembly while emitting an object, they're totally different.

Right, there is no way to generate both assembler and an object file. The non-LTO case also has the following difference

* `clang -c a.c` => MCObjectStreamer
* `clang -c -save-temps a.c` => MCAsmStreamer + integrated assembler

While we try very hard to make their behaviors similar, there are likely still many issues.

https://github.com/llvm/llvm-project/pull/195922


More information about the llvm-commits mailing list