about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/allocator.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-01 16:29:33 +0000
committerbors <bors@rust-lang.org>2021-04-01 16:29:33 +0000
commitd474075a8f28ae9a410e95d849d009006db4b176 (patch)
tree4334803e553593faa77f0954fa48de7477c9de45 /compiler/rustc_codegen_llvm/src/allocator.rs
parent803ddb83598838fb9de308d283b759ba463e5e80 (diff)
parentf3dde45d2a963c32994a78f3ea0119a2da973c14 (diff)
downloadrust-d474075a8f28ae9a410e95d849d009006db4b176.tar.gz
rust-d474075a8f28ae9a410e95d849d009006db4b176.zip
Auto merge of #82780 - cjgillot:dep-stream, r=michaelwoerister
Stream the dep-graph to a file instead of storing it in-memory.

This is a reimplementation of #60035.

Instead of storing the dep-graph in-memory, the nodes are encoded as they come
into the a temporary file as they come. At the end of a successful the compilation,
this file is renamed to be the persistent dep-graph, to be decoded during the next
compilation session.

This two-files scheme avoids overwriting the dep-graph on unsuccessful or crashing compilations.

The structure of the file is modified to be the sequence of `(DepNode, Fingerprint, EdgesVec)`.
The deserialization is responsible for going to the more compressed representation.
The `node_count` and `edge_count` are stored in the last 16 bytes of the file,
in order to accurately reserve capacity for the vectors.

At the end of the compilation, the encoder is flushed and dropped.
The graph is not usable after this point: any creation of a node will ICE.

I had to retrofit the debugging options, which is not really pretty.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/allocator.rs')
0 files changed, 0 insertions, 0 deletions