fixing freebsd unused import warning in core affinity. (#897)
fixing clang wrapper test passing llvm pass api support when there are actual passes. Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
This commit is contained in:
parent
ec38858b2d
commit
d77769540a
@ -642,7 +642,7 @@ mod freebsd {
|
|||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use std::{mem, thread::available_parallelism};
|
use std::{mem, thread::available_parallelism};
|
||||||
|
|
||||||
use libc::{cpuset_getaffinity, cpuset_setaffinity, cpuset_t, CPU_SET};
|
use libc::{cpuset_setaffinity, cpuset_t, CPU_SET};
|
||||||
|
|
||||||
use super::CoreId;
|
use super::CoreId;
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
@ -688,7 +688,7 @@ mod freebsd {
|
|||||||
|
|
||||||
// Try to get current core affinity mask.
|
// Try to get current core affinity mask.
|
||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
cpuset_getaffinity(
|
libc::cpuset_getaffinity(
|
||||||
CPU_LEVEL_WHICH,
|
CPU_LEVEL_WHICH,
|
||||||
CPU_WHICH_PID,
|
CPU_WHICH_PID,
|
||||||
-1, // Defaults to current thread
|
-1, // Defaults to current thread
|
||||||
|
@ -297,10 +297,12 @@ impl CompilerWrapper for ClangWrapper {
|
|||||||
return Ok(args);
|
return Ok(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.use_new_pm {
|
if !self.passes.is_empty() {
|
||||||
args.push("-fexperimental-new-pass-manager".into());
|
if self.use_new_pm {
|
||||||
} else {
|
args.push("-fexperimental-new-pass-manager".into());
|
||||||
args.push("-flegacy-pass-manager".into());
|
} else {
|
||||||
|
args.push("-flegacy-pass-manager".into());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for pass in &self.passes {
|
for pass in &self.passes {
|
||||||
if self.use_new_pm {
|
if self.use_new_pm {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user