1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/tools
Alexey Lapshin c75c8e75b3 [llvm-objcopy][NFC] replace class Buffer/MemBuffer/FileBuffer with streams.
During D88827 it was requested to remove the local implementation
of Memory/File Buffers:

// TODO: refactor the buffer classes in LLVM to enable us to use them here
// directly.

This patch uses raw_ostream instead of Buffers. Generally, using streams
could allow us to reduce memory usages. No need to load all data into the
memory - the data could be streamed through a smaller buffer.
Thus, this patch uses raw_ostream as an interface for output data:

Error executeObjcopyOnBinary(CopyConfig &Config,
                             object::Binary &In,
                             raw_ostream &Out);

Note 1. This patch does not change the implementation of Writers
so that data would be directly stored into raw_ostream.
This is assumed to be done later.

Note 2. It would be better if Writers would be implemented in a such way
that data could be streamed without seeking/updating. If that would be
inconvenient then raw_ostream could be replaced with raw_pwrite_stream
to have a possibility to seek back and update file headers.
This is assumed to be done later if necessary.

Note 3. Current FileOutputBuffer allows using a memory-mapped file.
The raw_fd_ostream (which could be used if data should be stored in the file)
does not allow us to use a memory-mapped file. Memory map functionality
could be implemented for raw_fd_ostream:

It is possible to add resize() method into raw_ostream.

class raw_ostream {
  void resize(uint64_t size);
}

That method, implemented for raw_fd_ostream, could create a memory-mapped file.
The streamed data would be written into that memory file then.
Thus we would be able to use memory-mapped files with raw_fd_ostream.
This is assumed to be done later if necessary.

Differential Revision: https://reviews.llvm.org/D91028
2021-03-10 23:50:04 +03:00
..
bugpoint Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds 2021-03-10 11:17:34 +00:00
bugpoint-passes
dsymutil Mark output as text if it is really text 2021-02-12 07:14:21 -05:00
gold [gold] Match lld WPD behavior for shared library symbols and add test 2021-02-17 15:28:49 -08:00
llc [Diagnose] Unify MCContext and LLVMContext diagnosing 2021-03-01 15:58:37 -08:00
lli [lli] Add JITLink link component after 99a6d003edbe 2021-03-03 23:14:26 +01:00
llvm-ar
llvm-as
llvm-as-fuzzer
llvm-bcanalyzer
llvm-c-test LLVM-C: Allow LLVM{Get/Set}Alignment on an atomicrmw/cmpxchg instruction. 2021-02-12 18:31:18 -05:00
llvm-cat
llvm-cfi-verify [llvm-cfi-verify] Set UseSymbolTable to false 2021-02-10 09:44:13 -08:00
llvm-config
llvm-cov [llvm-cov] Cache file status information 2021-03-03 10:04:07 -08:00
llvm-cvtres [llvm] Don't include StringSwitch.h where unnecessary (NFC) 2021-01-21 19:59:48 -08:00
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
llvm-diff
llvm-dis
llvm-dwarfdump [llvm-dwarfdump] StringMap -> MapVector to make iteration order stable 2021-02-25 20:05:05 -08:00
llvm-dwp [llvm-dwp] Join dwo paths correctly when DWOPath is absolute 2021-02-16 13:38:35 -08:00
llvm-elfabi
llvm-exegesis Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds 2021-03-10 11:17:34 +00:00
llvm-extract
llvm-go
llvm-gsymutil
llvm-ifs [llvm-ifs] Add option to use InterfaceStub library 2021-03-04 11:28:49 -08:00
llvm-isel-fuzzer
llvm-itanium-demangle-fuzzer
llvm-jitlink [cmake] Link socket/nsl on SunOS in llvm-jitlink 2021-03-09 19:04:59 +01:00
llvm-jitlistener
llvm-libtool-darwin [llvm-libtool] Emit warnings for files without symbols 2021-02-16 17:52:12 -08:00
llvm-link [llvm-link] Improve link time for bitcode archives [NFC] 2021-01-19 16:41:28 -08:00
llvm-lipo
llvm-lto Recommit "[LTO] Use lto::backend for code generation." 2021-02-15 10:05:42 +00:00
llvm-lto2 [LTO] Add support for existing Config::Freestanding option. 2021-01-22 13:45:39 +00:00
llvm-mc
llvm-mc-assemble-fuzzer
llvm-mc-disassemble-fuzzer
llvm-mca [MCA] Add support for in-order CPUs 2021-03-04 14:08:19 +03:00
llvm-microsoft-demangle-fuzzer
llvm-ml
llvm-modextract
llvm-mt
llvm-nm llvm-nm: add flag to suppress no symbols warning 2021-03-07 16:20:13 -08:00
llvm-objcopy [llvm-objcopy][NFC] replace class Buffer/MemBuffer/FileBuffer with streams. 2021-03-10 23:50:04 +03:00
llvm-objdump [llvm-objdump][MachO] Add support for dumping function starts 2021-03-08 18:44:44 -08:00
llvm-opt-fuzzer [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
llvm-opt-report
llvm-pdbutil [llvm] Remove redundant return and continue statements (NFC) 2021-01-14 20:30:34 -08:00
llvm-profdata [CSSPGO] llvm-profdata support for CS profile. 2021-03-08 09:04:40 -08:00
llvm-profgen [CSSPGO][llvm-profgen] Change sample count of dangling probe in llvm-profgen 2021-03-08 14:36:02 -08:00
llvm-rc
llvm-readobj [llvm-readelf] Support dumping the BB address map section with --bb-addr-map. 2021-03-08 16:20:11 -08:00
llvm-reduce [llvm-reduce] ReduceGlobalVarInitializers delta pass: fix handling of globals w/ comdat/non-external linkage 2021-01-07 18:05:03 +03:00
llvm-rtdyld
llvm-shlib
llvm-size
llvm-special-case-list-fuzzer
llvm-split [LTO] Update splitCodeGen to take a reference to the module. (NFC) 2021-01-29 11:53:11 +00:00
llvm-stress Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds 2021-03-10 11:17:34 +00:00
llvm-strings
llvm-symbolizer [llvm-symbolizer] - Fix the crash in GNU output style with --no-inlines and missing input file. 2021-01-30 18:36:38 +03:00
llvm-undname
llvm-xray [llvm] Use llvm::is_contained (NFC) 2021-02-14 08:36:20 -08:00
llvm-yaml-numeric-parser-fuzzer [llvm] NFC: Cleanup llvm-yaml-numeric-parser-fuzzer 2021-02-15 14:52:53 +01:00
llvm-yaml-parser-fuzzer
lto [llvm] Use append_range (NFC) 2021-01-29 23:23:34 -08:00
msbuild
obj2yaml [WebAssembly][yaml2obj][obj2yaml] Elem sections for nonzero tables 2021-03-05 11:45:15 +01:00
opt Remove original implementation of UniqueInternalLinkageNames pass. 2021-03-10 11:57:40 -08:00
opt-viewer
remarks-shlib
sancov
sanstats
split-file
verify-uselistorder
vfabi-demangle-fuzzer
xcode-toolchain
yaml2obj
CMakeLists.txt