[PATCH] D137217: [LTO][COFF] Use bitcode file names in lto native object file names.

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 17:14:20 PDT 2022


zequanwu created this revision.
zequanwu added reviewers: rnk, tejohnson, mehdi_amini.
Herald added subscribers: pmatos, asb, ormris, steven_wu, hiraditya, arichardson, inglorion, sbc100, emaste.
Herald added a reviewer: MaskRay.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
zequanwu requested review of this revision.
Herald added subscribers: llvm-commits, lldb-commits, cfe-commits, StephenFan, aheejin.
Herald added projects: clang, LLDB, LLVM.

Currently the lto native object files have names like main.exe.lto.1.obj. In
PDB, those names are used as names for each compiland. Microsoft’s tool
SizeBench uses those names to present to users the size of each object files.
So, names like main.exe.lto.1.obj is not user friendly.

This patch makes the lto native object file names more readable by using
the bitcode file names as part of the file names. For example, if the input
bitcode file has path like "path/to/foo.obj", its corresponding lto native
object file path would be "path/to/main.exe.lto.foo.obj". Since the lto native
object file name only bothers PDB, this patch only changes the lld-linker's
behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137217

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
  lld/COFF/LTO.cpp
  lld/COFF/LTO.h
  lld/ELF/LTO.cpp
  lld/MachO/LTO.cpp
  lld/test/COFF/lto-obj-path.ll
  lld/test/COFF/pdb-thinlto.ll
  lld/test/COFF/thinlto.ll
  lld/wasm/LTO.cpp
  lldb/source/Core/DataFileCache.cpp
  llvm/include/llvm/Support/Caching.h
  llvm/lib/Debuginfod/Debuginfod.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/Support/Caching.cpp
  llvm/tools/llvm-lto/llvm-lto.cpp
  llvm/tools/llvm-lto2/llvm-lto2.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137217.472464.patch
Type: text/x-patch
Size: 24315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221102/67b74773/attachment-0001.bin>


More information about the cfe-commits mailing list