Crate rustc_incremental[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Support for serializing the dep-graph and reloading it.

Re-exports

extern crate std;
extern crate graphviz;
extern crate rustc;
extern crate rustc_data_structures;
extern crate serialize as rustc_serialize;
extern crate rand;
extern crate log;
extern crate syntax;
extern crate syntax_pos;
use std::prelude::v1::*;

Modules

assert_dep_graph [
Experimental
]

This pass is only used for the UNIT TESTS and DEBUGGING NEEDS around dependency graph construction. It serves two purposes; it will dump graphs in graphviz form to disk, and it searches for #[rustc_if_this_changed] and #[rustc_then_this_would_need] annotations. These annotations can be used to test whether paths exist in the graph. These checks run after codegen, so they view the the final state of the dependency graph. Note that there are similar assertions found in persist::dirty_clean which check the initial state of the dependency graph, just after it has been loaded from disk.

assert_module_sources [
Experimental
]

This pass is only used for UNIT TESTS related to incremental compilation. It tests whether a particular .o file will be re-used from a previous compilation or whether it must be regenerated.

persist [
Experimental
]

When in incremental mode, this pass dumps out the dependency graph into the given directory. At the same time, it also hashes the various HIR nodes.

Enums

LoadResult [
Experimental
]

Functions

assert_dep_graph [
Experimental
]
copy_cgu_workproducts_to_incr_comp_cache_dir [
Experimental
]
delete_workproduct_files [
Experimental
]
dep_graph_tcx_init [
Experimental
]
finalize_session_directory [
Experimental
]

This function finalizes and thus 'publishes' the session directory by renaming it to s-{timestamp}-{svh} and releasing the file lock. If there have been compilation errors, however, this function will just delete the presumably invalid session directory.

garbage_collect_session_directories [
Experimental
]
in_incr_comp_dir [
Experimental
]
load_dep_graph [
Experimental
]

Launch a thread and load the dependency graph in the background.

load_query_result_cache [
Experimental
]
prepare_session_directory [
Experimental
]

Allocates the private session directory. The boolean in the Ok() result indicates whether we should try loading a dep graph from the successfully initialized directory, or not. The post-condition of this fn is that we have a valid incremental compilation session directory, if the result is Ok. A valid session directory is one that contains a locked lock file. It may or may not contain a dep-graph and work products from a previous session. If the call fails, the fn may leave behind an invalid session directory. The garbage collection will take care of it.

save_dep_graph [
Experimental
]
save_work_product_index [
Experimental
]