Skip to content

Commit 8cbb829

Browse files
authored
Rollup merge of rust-lang#59938 - Centril:rollup-u6r5nca, r=Centril
Rollup of 9 pull requests Successful merges: - rust-lang#59655 (Use a proc macro to declare preallocated symbols) - rust-lang#59769 (compiletest normalization: preserve non-JSON lines such as ICEs) - rust-lang#59776 (Apply resource-suffix to search-index and source-files scripts as well) - rust-lang#59784 (Suggest importing macros from the crate root) - rust-lang#59812 (Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.) - rust-lang#59856 (update polonius-engine) - rust-lang#59874 (Clean up handling of `-Z pgo-gen` commandline option.) - rust-lang#59890 (Don't generate empty json variables) - rust-lang#59911 (Revert "compile crates under test w/ -Zemit-stack-sizes") Failed merges: r? @ghost
2 parents 30a61c9 + 22a6e9e commit 8cbb829

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1287
-353
lines changed

Cargo.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
18941894

18951895
[[package]]
18961896
name = "polonius-engine"
1897-
version = "0.6.2"
1897+
version = "0.7.0"
18981898
source = "registry+https://github.com/rust-lang/crates.io-index"
18991899
dependencies = [
19001900
"datafrog 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2328,7 +2328,7 @@ dependencies = [
23282328
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
23292329
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
23302330
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
2331-
"polonius-engine 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
2331+
"polonius-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
23322332
"rustc-rayon 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
23332333
"rustc-rayon-core 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
23342334
"rustc_apfloat 0.0.0",
@@ -2828,7 +2828,7 @@ dependencies = [
28282828
"graphviz 0.0.0",
28292829
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
28302830
"log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
2831-
"polonius-engine 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
2831+
"polonius-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
28322832
"rustc 0.0.0",
28332833
"rustc_apfloat 0.0.0",
28342834
"rustc_data_structures 0.0.0",
@@ -3374,6 +3374,7 @@ dependencies = [
33743374
"arena 0.0.0",
33753375
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
33763376
"rustc_data_structures 0.0.0",
3377+
"rustc_macros 0.1.0",
33773378
"scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
33783379
"serialize 0.0.0",
33793380
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4150,7 +4151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
41504151
"checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998"
41514152
"checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930"
41524153
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
4153-
"checksum polonius-engine 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2490c396085801abf88df91758bad806b0890354f0875d624e62ecf0579a8145"
4154+
"checksum polonius-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24942fee141ea45628484a453762bb7e515099c3ec05fbeb76b7bf57b1aeed"
41544155
"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
41554156
"checksum pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a029430f0d744bc3d15dd474d591bed2402b645d024583082b9f63bb936dac6"
41564157
"checksum pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8b3f4e0475def7d9c2e5de8e5a1306949849761e107b360d03e98eafaffd61"

src/bootstrap/bin/rustc.rs

-27
Original file line numberDiff line numberDiff line change
@@ -187,33 +187,6 @@ fn main() {
187187
cmd.arg("-C").arg(format!("debug-assertions={}", debug_assertions));
188188
}
189189

190-
// Build all crates in the `std` facade with `-Z emit-stack-sizes` to add stack usage
191-
// information.
192-
//
193-
// When you use this `-Z` flag with Cargo you get stack usage information on all crates
194-
// compiled from source, and when you are using LTO you also get information on pre-compiled
195-
// crates like `core` and `std`, even if they were not compiled with `-Z emit-stack-sizes`.
196-
// However, there's an exception: `compiler_builtins`. This crate is special and doesn't
197-
// participate in LTO because it's always linked as a separate object file. For this reason
198-
// it's impossible to get stack usage information about `compiler-builtins` using
199-
// `RUSTFLAGS` + Cargo, or `cargo rustc`.
200-
//
201-
// To make the stack usage information of all crates under the `std` facade available to
202-
// Cargo based stack usage analysis tools, in both LTO and non-LTO mode, we compile them
203-
// with the `-Z emit-stack-sizes` flag. The `RUSTC_EMIT_STACK_SIZES` var helps us apply this
204-
// flag only to the crates in the `std` facade. The `-Z` flag is known to currently work
205-
// with targets that produce ELF files so we limit its use flag to those targets.
206-
//
207-
// NOTE(japaric) if this ever causes problem with an LLVM upgrade or any PR feel free to
208-
// remove it or comment it out
209-
if env::var_os("RUSTC_EMIT_STACK_SIZES").is_some()
210-
&& (target.contains("-linux-")
211-
|| target.contains("-none-eabi")
212-
|| target.ends_with("-none-elf"))
213-
{
214-
cmd.arg("-Zemit-stack-sizes");
215-
}
216-
217190
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
218191
cmd.arg("-C").arg(format!("codegen-units={}", s));
219192
}

src/bootstrap/compile.rs

-4
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ impl Step for Std {
9797
let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage));
9898
builder.info(&format!("Building stage{} std artifacts ({} -> {})", compiler.stage,
9999
&compiler.host, target));
100-
// compile with `-Z emit-stack-sizes`; see bootstrap/src/rustc.rs for more details
101-
cargo.env("RUSTC_EMIT_STACK_SIZES", "1");
102100
run_cargo(builder,
103101
&mut cargo,
104102
&libstd_stamp(builder, compiler, target),
@@ -397,8 +395,6 @@ impl Step for Test {
397395
let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage));
398396
builder.info(&format!("Building stage{} test artifacts ({} -> {})", compiler.stage,
399397
&compiler.host, target));
400-
// compile with `-Z emit-stack-sizes`; see bootstrap/src/rustc.rs for more details
401-
cargo.env("RUSTC_EMIT_STACK_SIZES", "1");
402398
run_cargo(builder,
403399
&mut cargo,
404400
&libtest_stamp(builder, compiler, target),

src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ lazy_static = "1.0.0"
1919
num_cpus = "1.0"
2020
scoped-tls = "1.0"
2121
log = { version = "0.4", features = ["release_max_level_info", "std"] }
22-
polonius-engine = "0.6.2"
22+
polonius-engine = "0.7.0"
2323
rustc-rayon = "0.1.2"
2424
rustc-rayon-core = "0.1.2"
2525
rustc_apfloat = { path = "../librustc_apfloat" }

src/librustc/middle/lib_features.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::ty::TyCtxt;
88
use crate::hir::intravisit::{self, NestedVisitorMap, Visitor};
99
use syntax::symbol::Symbol;
1010
use syntax::ast::{Attribute, MetaItem, MetaItemKind};
11-
use syntax_pos::Span;
11+
use syntax_pos::{Span, symbols};
1212
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
1313
use rustc_macros::HashStable;
1414
use errors::DiagnosticId;
@@ -51,12 +51,12 @@ impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
5151
}
5252

5353
fn extract(&self, attr: &Attribute) -> Option<(Symbol, Option<Symbol>, Span)> {
54-
let stab_attrs = vec!["stable", "unstable", "rustc_const_unstable"];
54+
let stab_attrs = [symbols::stable, symbols::unstable, symbols::rustc_const_unstable];
5555

5656
// Find a stability attribute (i.e., `#[stable (..)]`, `#[unstable (..)]`,
5757
// `#[rustc_const_unstable (..)]`).
5858
if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| {
59-
attr.check_name(stab_attr)
59+
attr.check_name(**stab_attr)
6060
}) {
6161
let meta_item = attr.meta();
6262
if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta_item {

src/librustc/session/config.rs

+32-6
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ impl LinkerPluginLto {
113113
}
114114
}
115115

116+
#[derive(Clone, PartialEq, Hash)]
117+
pub enum PgoGenerate {
118+
Enabled(Option<PathBuf>),
119+
Disabled,
120+
}
121+
122+
impl PgoGenerate {
123+
pub fn enabled(&self) -> bool {
124+
match *self {
125+
PgoGenerate::Enabled(_) => true,
126+
PgoGenerate::Disabled => false,
127+
}
128+
}
129+
}
130+
116131
#[derive(Clone, Copy, PartialEq, Hash)]
117132
pub enum DebugInfo {
118133
None,
@@ -826,13 +841,15 @@ macro_rules! options {
826841
pub const parse_linker_plugin_lto: Option<&str> =
827842
Some("either a boolean (`yes`, `no`, `on`, `off`, etc), \
828843
or the path to the linker plugin");
844+
pub const parse_pgo_generate: Option<&str> =
845+
Some("an optional path to the profiling data output directory");
829846
pub const parse_merge_functions: Option<&str> =
830847
Some("one of: `disabled`, `trampolines`, or `aliases`");
831848
}
832849

833850
#[allow(dead_code)]
834851
mod $mod_set {
835-
use super::{$struct_name, Passes, Sanitizer, LtoCli, LinkerPluginLto};
852+
use super::{$struct_name, Passes, Sanitizer, LtoCli, LinkerPluginLto, PgoGenerate};
836853
use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
837854
use std::path::PathBuf;
838855
use std::str::FromStr;
@@ -1087,6 +1104,14 @@ macro_rules! options {
10871104
true
10881105
}
10891106

1107+
fn parse_pgo_generate(slot: &mut PgoGenerate, v: Option<&str>) -> bool {
1108+
*slot = match v {
1109+
None => PgoGenerate::Enabled(None),
1110+
Some(path) => PgoGenerate::Enabled(Some(PathBuf::from(path))),
1111+
};
1112+
true
1113+
}
1114+
10901115
fn parse_merge_functions(slot: &mut Option<MergeFunctions>, v: Option<&str>) -> bool {
10911116
match v.and_then(|s| MergeFunctions::from_str(s).ok()) {
10921117
Some(mergefunc) => *slot = Some(mergefunc),
@@ -1363,7 +1388,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13631388
"extra arguments to prepend to the linker invocation (space separated)"),
13641389
profile: bool = (false, parse_bool, [TRACKED],
13651390
"insert profiling code"),
1366-
pgo_gen: Option<String> = (None, parse_opt_string, [TRACKED],
1391+
pgo_gen: PgoGenerate = (PgoGenerate::Disabled, parse_pgo_generate, [TRACKED],
13671392
"Generate PGO profile data, to a given file, or to the default location if it's empty."),
13681393
pgo_use: String = (String::new(), parse_string, [TRACKED],
13691394
"Use PGO profile data from the given profile file."),
@@ -1980,7 +2005,7 @@ pub fn build_session_options_and_crate_config(
19802005
);
19812006
}
19822007

1983-
if debugging_opts.pgo_gen.is_some() && !debugging_opts.pgo_use.is_empty() {
2008+
if debugging_opts.pgo_gen.enabled() && !debugging_opts.pgo_use.is_empty() {
19842009
early_error(
19852010
error_format,
19862011
"options `-Z pgo-gen` and `-Z pgo-use` are exclusive",
@@ -2490,7 +2515,7 @@ mod dep_tracking {
24902515
use std::path::PathBuf;
24912516
use std::collections::hash_map::DefaultHasher;
24922517
use super::{CrateType, DebugInfo, ErrorOutputType, OptLevel, OutputTypes,
2493-
Passes, Sanitizer, LtoCli, LinkerPluginLto};
2518+
Passes, Sanitizer, LtoCli, LinkerPluginLto, PgoGenerate};
24942519
use syntax::feature_gate::UnstableFeatures;
24952520
use rustc_target::spec::{MergeFunctions, PanicStrategy, RelroLevel, TargetTriple};
24962521
use syntax::edition::Edition;
@@ -2558,6 +2583,7 @@ mod dep_tracking {
25582583
impl_dep_tracking_hash_via_hash!(TargetTriple);
25592584
impl_dep_tracking_hash_via_hash!(Edition);
25602585
impl_dep_tracking_hash_via_hash!(LinkerPluginLto);
2586+
impl_dep_tracking_hash_via_hash!(PgoGenerate);
25612587

25622588
impl_dep_tracking_hash_for_sortable_vec_of!(String);
25632589
impl_dep_tracking_hash_for_sortable_vec_of!(PathBuf);
@@ -2625,7 +2651,7 @@ mod tests {
26252651
build_session_options_and_crate_config,
26262652
to_crate_config
26272653
};
2628-
use crate::session::config::{LtoCli, LinkerPluginLto};
2654+
use crate::session::config::{LtoCli, LinkerPluginLto, PgoGenerate};
26292655
use crate::session::build_session;
26302656
use crate::session::search_paths::SearchPath;
26312657
use std::collections::{BTreeMap, BTreeSet};
@@ -3124,7 +3150,7 @@ mod tests {
31243150
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
31253151

31263152
opts = reference.clone();
3127-
opts.debugging_opts.pgo_gen = Some(String::from("abc"));
3153+
opts.debugging_opts.pgo_gen = PgoGenerate::Enabled(None);
31283154
assert_ne!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
31293155

31303156
opts = reference.clone();

src/librustc_codegen_llvm/attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn set_probestack(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
104104
}
105105

106106
// probestack doesn't play nice either with pgo-gen.
107-
if cx.sess().opts.debugging_opts.pgo_gen.is_some() {
107+
if cx.sess().opts.debugging_opts.pgo_gen.enabled() {
108108
return;
109109
}
110110

src/librustc_codegen_llvm/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ fn link_args(cmd: &mut dyn Linker,
10141014
cmd.build_static_executable();
10151015
}
10161016

1017-
if sess.opts.debugging_opts.pgo_gen.is_some() {
1017+
if sess.opts.debugging_opts.pgo_gen.enabled() {
10181018
cmd.pgo_gen();
10191019
}
10201020

src/librustc_codegen_llvm/back/write.rs

+33-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::LlvmCodegenBackend;
1313
use rustc::hir::def_id::LOCAL_CRATE;
1414
use rustc_codegen_ssa::back::write::{CodegenContext, ModuleConfig, run_assembler};
1515
use rustc_codegen_ssa::traits::*;
16-
use rustc::session::config::{self, OutputType, Passes, Lto};
16+
use rustc::session::config::{self, OutputType, Passes, Lto, PgoGenerate};
1717
use rustc::session::Session;
1818
use rustc::ty::TyCtxt;
1919
use rustc_codegen_ssa::{ModuleCodegen, CompiledModule};
@@ -26,7 +26,7 @@ use errors::{Handler, FatalError};
2626
use std::ffi::{CString, CStr};
2727
use std::fs;
2828
use std::io::{self, Write};
29-
use std::path::Path;
29+
use std::path::{Path, PathBuf};
3030
use std::str;
3131
use std::sync::Arc;
3232
use std::slice;
@@ -708,10 +708,20 @@ pub unsafe fn with_llvm_pmb(llmod: &llvm::Module,
708708
.unwrap_or(llvm::CodeGenOptSizeNone);
709709
let inline_threshold = config.inline_threshold;
710710

711-
let pgo_gen_path = config.pgo_gen.as_ref().map(|s| {
712-
let s = if s.is_empty() { "default_%m.profraw" } else { s };
713-
CString::new(s.as_bytes()).unwrap()
714-
});
711+
let pgo_gen_path = match config.pgo_gen {
712+
PgoGenerate::Enabled(ref opt_dir_path) => {
713+
let path = if let Some(dir_path) = opt_dir_path {
714+
dir_path.join("default_%m.profraw")
715+
} else {
716+
PathBuf::from("default_%m.profraw")
717+
};
718+
719+
Some(CString::new(format!("{}", path.display())).unwrap())
720+
}
721+
PgoGenerate::Disabled => {
722+
None
723+
}
724+
};
715725

716726
let pgo_use_path = if config.pgo_use.is_empty() {
717727
None
@@ -795,21 +805,31 @@ fn create_msvc_imps(
795805
} else {
796806
"\x01__imp_"
797807
};
808+
798809
unsafe {
799810
let i8p_ty = Type::i8p_llcx(llcx);
800811
let globals = base::iter_globals(llmod)
801812
.filter(|&val| {
802813
llvm::LLVMRustGetLinkage(val) == llvm::Linkage::ExternalLinkage &&
803814
llvm::LLVMIsDeclaration(val) == 0
804815
})
805-
.map(move |val| {
816+
.filter_map(|val| {
817+
// Exclude some symbols that we know are not Rust symbols.
806818
let name = CStr::from_ptr(llvm::LLVMGetValueName(val));
819+
if ignored(name.to_bytes()) {
820+
None
821+
} else {
822+
Some((val, name))
823+
}
824+
})
825+
.map(move |(val, name)| {
807826
let mut imp_name = prefix.as_bytes().to_vec();
808827
imp_name.extend(name.to_bytes());
809828
let imp_name = CString::new(imp_name).unwrap();
810829
(imp_name, val)
811830
})
812831
.collect::<Vec<_>>();
832+
813833
for (imp_name, val) in globals {
814834
let imp = llvm::LLVMAddGlobal(llmod,
815835
i8p_ty,
@@ -818,4 +838,10 @@ fn create_msvc_imps(
818838
llvm::LLVMRustSetLinkage(imp, llvm::Linkage::ExternalLinkage);
819839
}
820840
}
841+
842+
// Use this function to exclude certain symbols from `__imp` generation.
843+
fn ignored(symbol_name: &[u8]) -> bool {
844+
// These are symbols generated by LLVM's profiling instrumentation
845+
symbol_name.starts_with(b"__llvm_profile_")
846+
}
821847
}

src/librustc_codegen_ssa/back/symbol_export.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
209209
}
210210
}
211211

212-
if tcx.sess.opts.debugging_opts.pgo_gen.is_some() {
212+
if tcx.sess.opts.debugging_opts.pgo_gen.enabled() {
213213
// These are weak symbols that point to the profile version and the
214214
// profile name, which need to be treated as exported so LTO doesn't nix
215215
// them.

src/librustc_codegen_ssa/back/write.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use rustc_incremental::{copy_cgu_workproducts_to_incr_comp_cache_dir,
1212
use rustc::dep_graph::{WorkProduct, WorkProductId, WorkProductFileKind};
1313
use rustc::dep_graph::cgu_reuse_tracker::CguReuseTracker;
1414
use rustc::middle::cstore::EncodedMetadata;
15-
use rustc::session::config::{self, OutputFilenames, OutputType, Passes, Sanitizer, Lto};
15+
use rustc::session::config::{self, OutputFilenames, OutputType, Passes, Lto,
16+
Sanitizer, PgoGenerate};
1617
use rustc::session::Session;
1718
use rustc::util::nodemap::FxHashMap;
1819
use rustc::hir::def_id::{CrateNum, LOCAL_CRATE};
@@ -56,7 +57,7 @@ pub struct ModuleConfig {
5657
/// Some(level) to optimize binary size, or None to not affect program size.
5758
pub opt_size: Option<config::OptLevel>,
5859

59-
pub pgo_gen: Option<String>,
60+
pub pgo_gen: PgoGenerate,
6061
pub pgo_use: String,
6162

6263
// Flags indicating which outputs to produce.
@@ -94,7 +95,7 @@ impl ModuleConfig {
9495
opt_level: None,
9596
opt_size: None,
9697

97-
pgo_gen: None,
98+
pgo_gen: PgoGenerate::Disabled,
9899
pgo_use: String::new(),
99100

100101
emit_no_opt_bc: false,

src/librustc_incremental/persist/dirty_clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ impl<'a, 'tcx> FindAllAttrs<'a, 'tcx> {
599599

600600
fn is_active_attr(&mut self, attr: &Attribute) -> bool {
601601
for attr_name in &self.attr_names {
602-
if attr.check_name(attr_name) && check_config(self.tcx, attr) {
602+
if attr.check_name(*attr_name) && check_config(self.tcx, attr) {
603603
return true;
604604
}
605605
}

src/librustc_lint/unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
228228

229229
let plugin_attributes = cx.sess().plugin_attributes.borrow_mut();
230230
for &(ref name, ty) in plugin_attributes.iter() {
231-
if ty == AttributeType::Whitelisted && attr.check_name(&name) {
231+
if ty == AttributeType::Whitelisted && attr.check_name(&**name) {
232232
debug!("{:?} (plugin attr) is whitelisted with ty {:?}", name, ty);
233233
break;
234234
}

0 commit comments

Comments
 (0)