"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],
}
}
+ 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");
}
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 {