2019-12-31 19:24:05 -06:00
|
|
|
use crate::session::Session;
|
|
|
|
use rustc_data_structures::profiling::VerboseTimingGuard;
|
2019-11-12 07:30:40 -06:00
|
|
|
|
2019-12-31 19:24:05 -06:00
|
|
|
impl Session {
|
2020-01-07 14:34:08 -06:00
|
|
|
pub fn timer<'a>(&'a self, what: &'static str) -> VerboseTimingGuard<'a> {
|
|
|
|
self.prof.verbose_generic_activity(what)
|
2019-12-31 19:24:05 -06:00
|
|
|
}
|
2020-01-07 14:34:08 -06:00
|
|
|
pub fn time<R>(&self, what: &'static str, f: impl FnOnce() -> R) -> R {
|
|
|
|
self.prof.verbose_generic_activity(what).run(f)
|
2019-12-31 19:24:05 -06:00
|
|
|
}
|
2019-11-12 07:30:40 -06:00
|
|
|
}
|
2019-11-14 11:16:24 -06:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
|
|
|
pub enum NativeLibraryKind {
|
|
|
|
/// native static library (.a archive)
|
|
|
|
NativeStatic,
|
|
|
|
/// native static library, which doesn't get bundled into .rlibs
|
|
|
|
NativeStaticNobundle,
|
|
|
|
/// macOS-specific
|
|
|
|
NativeFramework,
|
|
|
|
/// Windows dynamic library without import library.
|
|
|
|
NativeRawDylib,
|
|
|
|
/// default way to specify a dynamic library
|
|
|
|
NativeUnknown,
|
|
|
|
}
|
|
|
|
|
|
|
|
rustc_data_structures::impl_stable_hash_via_hash!(NativeLibraryKind);
|