[PATCH] D24622: LTO: Simplify caching interface.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 13:14:43 PDT 2016


pcc created this revision.
pcc added reviewers: tejohnson, mehdi_amini.
pcc added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

The NativeObjectOutput class has a design problem: it mixes up the caching
policy with the interface for output streams, which makes the client-side
code hard to follow and would for example make it harder to replace the
cache implementation in an arbitrary client.

This change separates the two aspects by moving the caching policy
to a separate field in Config, replacing NativeObjectOutput with a
NativeObjectStream class which only deals with streams and does not need to
be overridden by most clients and introducing an AddFile callback for adding
files (e.g. from the cache) to the link.

https://reviews.llvm.org/D24622

Files:
  include/llvm/LTO/Caching.h
  include/llvm/LTO/Config.h
  include/llvm/LTO/LTO.h
  include/llvm/LTO/LTOBackend.h
  lib/LTO/Caching.cpp
  lib/LTO/LTO.cpp
  lib/LTO/LTOBackend.cpp
  tools/gold/gold-plugin.cpp
  tools/llvm-lto2/llvm-lto2.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24622.71541.patch
Type: text/x-patch
Size: 32245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160915/f4c2cd6a/attachment-0001.bin>


More information about the llvm-commits mailing list