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 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 crate::Error;
|
||||
@ -688,7 +688,7 @@ mod freebsd {
|
||||
|
||||
// Try to get current core affinity mask.
|
||||
let result = unsafe {
|
||||
cpuset_getaffinity(
|
||||
libc::cpuset_getaffinity(
|
||||
CPU_LEVEL_WHICH,
|
||||
CPU_WHICH_PID,
|
||||
-1, // Defaults to current thread
|
||||
|
@ -297,10 +297,12 @@ impl CompilerWrapper for ClangWrapper {
|
||||
return Ok(args);
|
||||
}
|
||||
|
||||
if self.use_new_pm {
|
||||
args.push("-fexperimental-new-pass-manager".into());
|
||||
} else {
|
||||
args.push("-flegacy-pass-manager".into());
|
||||
if !self.passes.is_empty() {
|
||||
if self.use_new_pm {
|
||||
args.push("-fexperimental-new-pass-manager".into());
|
||||
} else {
|
||||
args.push("-flegacy-pass-manager".into());
|
||||
}
|
||||
}
|
||||
for pass in &self.passes {
|
||||
if self.use_new_pm {
|
||||
|
Loading…
x
Reference in New Issue
Block a user