Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add a -Z query_threads compiler option
  • Loading branch information
Zoxc committed Dec 8, 2017
commit 79ff21235a3ee5401e311f8980baebfa85b5cba2
6 changes: 6 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"prints the llvm optimization passes being run"),
ast_json: bool = (false, parse_bool, [UNTRACKED],
"print the AST as JSON and halt"),
query_threads: Option<usize> = (None, parse_opt_uint, [UNTRACKED],
"execute queries on a thread pool with N threads"),
ast_json_noexpand: bool = (false, parse_bool, [UNTRACKED],
"print the pre-expansion AST as JSON and halt"),
ls: bool = (false, parse_bool, [UNTRACKED],
Expand Down Expand Up @@ -1638,6 +1640,10 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
}
}

if debugging_opts.query_threads == Some(0) {
early_error(error_format, "Value for query threads must be a positive nonzero integer");
}

if codegen_units == Some(0) {
early_error(error_format, "Value for codegen units must be a positive nonzero integer");
}
Expand Down
6 changes: 6 additions & 0 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,12 @@ impl Session {
ret
}

/// Returns the number of query threads that should be used for this
/// compilation
pub fn query_threads(&self) -> usize {
self.opts.debugging_opts.query_threads.unwrap_or(1)
}

/// Returns the number of codegen units that should be used for this
/// compilation
pub fn codegen_units(&self) -> usize {
Expand Down