Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GlobalCtxt implement Sync #45912

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1263c9e
Add sync module to rustc_data_structures
Zoxc Dec 3, 2017
9ee978b
Make arenas thread safe
Zoxc Dec 3, 2017
a31997f
Combine GlobalArenas and DroplessArena into AllArenas
Zoxc Dec 3, 2017
2f2048c
A SameThread type is introduced in src/librustc_trans/metadata.rs whi…
Zoxc Dec 3, 2017
81ca5f9
Make mk_attr_id thread safe
Zoxc Dec 3, 2017
51d8948
Make err_count thread safe
Zoxc Dec 3, 2017
d8eb707
Refactor code so the call to codemap.files() does not deadlock
Zoxc Dec 3, 2017
461548e
Convert IGNORED_ATTR_NAMES into a global variable and initialize it o…
Zoxc Dec 3, 2017
79ff212
Add a -Z query_threads compiler option
Zoxc Dec 3, 2017
11524d5
Assert that GlobalCtxt is Sync
Zoxc Dec 3, 2017
a5f71b8
Make PROFQ_CHAN a global
Zoxc Dec 3, 2017
be828a0
Make IndexVec implement Send and Sync
Zoxc Dec 3, 2017
b66aab1
Make TransitiveRelation thread safe. Avoid locking by using get_mut i…
Zoxc Dec 3, 2017
e12074f
Remove useless Rc
Zoxc Dec 3, 2017
5549ada
Use rustc_erase_owner! which produces a Send + Sync erased owner if c…
Zoxc Dec 3, 2017
1155689
Add Encodable and Decodable impls for Arc<[T]>
Zoxc Dec 3, 2017
35fbe11
Make USED_ATTRS and KNOWN_ATTRS into globals
Zoxc Dec 3, 2017
5c4dacd
Make REGISTERED_DIAGNOSTICS a global
Zoxc Dec 3, 2017
9251af3
FIXME note + thread safety
Zoxc Dec 3, 2017
868dda0
Make HYGIENE_DATA a global
Zoxc Dec 3, 2017
2d3112a
Make Span and Symbol implement Send and Sync
Zoxc Dec 3, 2017
6e573cb
Make InternedString Send
Zoxc Dec 3, 2017
3bb008d
Make syntax_pos interners globals
Zoxc Dec 3, 2017
e3a63ed
Mechanical translation which results in GlobalCtxt being Sync
Zoxc Dec 3, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 72 additions & 17 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ fn main() {
}
}

if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() {
cmd.arg("--cfg").arg("parallel_queries");
}

let color = match env::var("RUSTC_COLOR") {
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
Err(_) => 0,
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ pub fn rustc_cargo(build: &Build,
if let Some(ref s) = build.config.rustc_default_linker {
cargo.env("CFG_DEFAULT_LINKER", s);
}
if build.config.rustc_parallel_queries {
cargo.env("RUSTC_PARALLEL_QUERIES", "1");
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub struct Config {
pub rust_debuginfo_lines: bool,
pub rust_debuginfo_only_std: bool,
pub rust_rpath: bool,
pub rustc_parallel_queries: bool,
pub rustc_default_linker: Option<String>,
pub rust_optimize_tests: bool,
pub rust_debuginfo_tests: bool,
Expand Down Expand Up @@ -266,6 +267,7 @@ struct Rust {
debuginfo: Option<bool>,
debuginfo_lines: Option<bool>,
debuginfo_only_std: Option<bool>,
experimental_parallel_queries: Option<bool>,
debug_jemalloc: Option<bool>,
use_jemalloc: Option<bool>,
backtrace: Option<bool>,
Expand Down Expand Up @@ -474,6 +476,7 @@ impl Config {
set(&mut config.rust_dist_src, rust.dist_src);
set(&mut config.quiet_tests, rust.quiet_tests);
set(&mut config.test_miri, rust.test_miri);
config.rustc_parallel_queries = rust.experimental_parallel_queries.unwrap_or(false);
config.rustc_default_linker = rust.default_linker.clone();
config.musl_root = rust.musl_root.clone().map(PathBuf::from);
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
Expand Down
3 changes: 3 additions & 0 deletions src/libarena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ version = "0.0.0"
name = "arena"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
rustc_data_structures = { path = "../librustc_data_structures" }
Copy link
Member

@bjorn3 bjorn3 Nov 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline

Loading