Skip to content

Commit aa4535c

Browse files
fitzgenKowasaki
authored andcommitted
Use trace! instead of debug! logging in the template analysis
These logs are pretty loud, so let's knock em down a log level.
1 parent 60dd28e commit aa4535c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/ir/named.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl<'ctx, 'gen> UsedTemplateParameters<'ctx, 'gen> {
317317
fn constrain_instantiation_of_blacklisted_template(&self,
318318
used_by_this_id: &mut ItemSet,
319319
instantiation: &TemplateInstantiation) {
320-
debug!(" instantiation of blacklisted template, uses all template \
320+
trace!(" instantiation of blacklisted template, uses all template \
321321
arguments");
322322

323323
let args = instantiation.template_arguments()
@@ -331,7 +331,7 @@ impl<'ctx, 'gen> UsedTemplateParameters<'ctx, 'gen> {
331331
fn constrain_instantiation(&self,
332332
used_by_this_id: &mut ItemSet,
333333
instantiation: &TemplateInstantiation) {
334-
debug!(" template instantiation");
334+
trace!(" template instantiation");
335335

336336
let decl = self.ctx.resolve_type(instantiation.template_definition());
337337
let args = instantiation.template_arguments();
@@ -344,20 +344,20 @@ impl<'ctx, 'gen> UsedTemplateParameters<'ctx, 'gen> {
344344
.unwrap();
345345

346346
for (arg, param) in args.iter().zip(params.iter()) {
347-
debug!(" instantiation's argument {:?} is used if definition's \
347+
trace!(" instantiation's argument {:?} is used if definition's \
348348
parameter {:?} is used",
349349
arg,
350350
param);
351351

352352
if used_by_def.contains(param) {
353-
debug!(" param is used by template definition");
353+
trace!(" param is used by template definition");
354354

355355
let arg = arg.into_resolver()
356356
.through_type_refs()
357357
.through_type_aliases()
358358
.resolve(self.ctx);
359359
if let Some(named) = arg.as_named(self.ctx, &()) {
360-
debug!(" arg is a type parameter, marking used");
360+
trace!(" arg is a type parameter, marking used");
361361
used_by_this_id.insert(named);
362362
}
363363
}
@@ -367,7 +367,7 @@ impl<'ctx, 'gen> UsedTemplateParameters<'ctx, 'gen> {
367367
/// The join operation on our lattice: the set union of all of this id's
368368
/// successors.
369369
fn constrain_join(&self, used_by_this_id: &mut ItemSet, item: &Item) {
370-
debug!(" other item: join with successors' usage");
370+
trace!(" other item: join with successors' usage");
371371

372372
item.trace(self.ctx, &mut |sub_id, edge_kind| {
373373
// Ignore ourselves, since union with ourself is a
@@ -388,7 +388,7 @@ impl<'ctx, 'gen> UsedTemplateParameters<'ctx, 'gen> {
388388
.iter()
389389
.cloned();
390390

391-
debug!(" union with {:?}'s usage: {:?}",
391+
trace!(" union with {:?}'s usage: {:?}",
392392
sub_id,
393393
used_by_sub_id.clone().collect::<Vec<_>>());
394394

@@ -508,8 +508,8 @@ impl<'ctx, 'gen> MonotoneFramework for UsedTemplateParameters<'ctx, 'gen> {
508508
// an analog to slice::split_at_mut.
509509
let mut used_by_this_id = self.take_this_id_usage_set(id);
510510

511-
debug!("constrain {:?}", id);
512-
debug!(" initially, used set is {:?}", used_by_this_id);
511+
trace!("constrain {:?}", id);
512+
trace!(" initially, used set is {:?}", used_by_this_id);
513513

514514
let original_len = used_by_this_id.len();
515515

@@ -518,7 +518,7 @@ impl<'ctx, 'gen> MonotoneFramework for UsedTemplateParameters<'ctx, 'gen> {
518518
match ty_kind {
519519
// Named template type parameters trivially use themselves.
520520
Some(&TypeKind::Named) => {
521-
debug!(" named type, trivially uses itself");
521+
trace!(" named type, trivially uses itself");
522522
used_by_this_id.insert(id);
523523
}
524524
// Template instantiations only use their template arguments if the
@@ -536,7 +536,7 @@ impl<'ctx, 'gen> MonotoneFramework for UsedTemplateParameters<'ctx, 'gen> {
536536
_ => self.constrain_join(&mut used_by_this_id, item),
537537
}
538538

539-
debug!(" finally, used set is {:?}", used_by_this_id);
539+
trace!(" finally, used set is {:?}", used_by_this_id);
540540

541541
let new_len = used_by_this_id.len();
542542
assert!(new_len >= original_len,
@@ -556,7 +556,7 @@ impl<'ctx, 'gen> MonotoneFramework for UsedTemplateParameters<'ctx, 'gen> {
556556
{
557557
if let Some(edges) = self.dependencies.get(&item) {
558558
for item in edges {
559-
debug!("enqueue {:?} into worklist", item);
559+
trace!("enqueue {:?} into worklist", item);
560560
f(*item);
561561
}
562562
}

0 commit comments

Comments
 (0)