Pass tune-cpu to LLVM
I think this is how it should work...
This commit is contained in:
parent
285fc7d704
commit
a35a93f09c
9 changed files with 80 additions and 8 deletions
|
@ -351,11 +351,7 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn target_cpu(sess: &Session) -> &str {
|
||||
let name = match sess.opts.cg.target_cpu {
|
||||
Some(ref s) => &**s,
|
||||
None => &*sess.target.target.options.cpu,
|
||||
};
|
||||
fn handle_native(name: &str) -> &str {
|
||||
if name != "native" {
|
||||
return name;
|
||||
}
|
||||
|
@ -366,3 +362,19 @@ pub fn target_cpu(sess: &Session) -> &str {
|
|||
str::from_utf8(slice::from_raw_parts(ptr as *const u8, len)).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn target_cpu(sess: &Session) -> &str {
|
||||
let name = match sess.opts.cg.target_cpu {
|
||||
Some(ref s) => &**s,
|
||||
None => &*sess.target.target.options.cpu,
|
||||
};
|
||||
|
||||
handle_native(name)
|
||||
}
|
||||
|
||||
pub fn tune_cpu(sess: &Session) -> Option<&str> {
|
||||
match sess.opts.debugging_opts.tune_cpu {
|
||||
Some(ref s) => Some(handle_native(&**s)),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue