Skip to content

Commit 0e674b3

Browse files
committed
Some tracing cleanups
1 parent 493c960 commit 0e674b3

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Diff for: compiler/rustc_codegen_llvm/src/builder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use std::ffi::CStr;
2828
use std::iter;
2929
use std::ops::Deref;
3030
use std::ptr;
31-
use tracing::debug;
31+
use tracing::{debug, instrument};
3232

3333
// All Builders must have an llfn associated with them
3434
#[must_use]
@@ -464,15 +464,15 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
464464
}
465465
}
466466

467+
#[instrument(level = "debug", skip(self))]
467468
fn load_operand(&mut self, place: PlaceRef<'tcx, &'ll Value>) -> OperandRef<'tcx, &'ll Value> {
468-
debug!("PlaceRef::load: {:?}", place);
469-
470469
assert_eq!(place.llextra.is_some(), place.layout.is_unsized());
471470

472471
if place.layout.is_zst() {
473472
return OperandRef::new_zst(self, place.layout);
474473
}
475474

475+
#[instrument(level = "trace", skip(bx))]
476476
fn scalar_load_metadata<'a, 'll, 'tcx>(
477477
bx: &mut Builder<'a, 'll, 'tcx>,
478478
load: &'ll Value,

Diff for: compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ extern "C" {
16231623
B: &Builder<'a>,
16241624
Val: &'a Value,
16251625
DestTy: &'a Type,
1626-
IsSized: bool,
1626+
IsSigned: bool,
16271627
) -> &'a Value;
16281628

16291629
// Comparisons

Diff for: compiler/rustc_codegen_ssa/src/mir/place.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
204204
}
205205

206206
/// Obtain the actual discriminant of a value.
207+
#[instrument(level = "trace", skip(bx))]
207208
pub fn codegen_get_discr<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
208209
self,
209210
bx: &mut Bx,
@@ -420,12 +421,12 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
420421
}
421422

422423
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
424+
#[instrument(level = "debug", skip(self, bx))]
423425
pub fn codegen_place(
424426
&mut self,
425427
bx: &mut Bx,
426428
place_ref: mir::PlaceRef<'tcx>,
427429
) -> PlaceRef<'tcx, Bx::Value> {
428-
debug!("codegen_place(place_ref={:?})", place_ref);
429430
let cx = self.cx;
430431
let tcx = self.cx.tcx();
431432

Diff for: compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ use rustc_span::source_map::{Span, DUMMY_SP};
1515
use rustc_target::abi::{Abi, Int, Variants};
1616

1717
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
18+
#[instrument(level = "debug", skip(self, bx))]
1819
pub fn codegen_rvalue(
1920
&mut self,
2021
mut bx: Bx,
2122
dest: PlaceRef<'tcx, Bx::Value>,
2223
rvalue: &mir::Rvalue<'tcx>,
2324
) -> Bx {
24-
debug!("codegen_rvalue(dest.llval={:?}, rvalue={:?})", dest.llval, rvalue);
25-
2625
match *rvalue {
2726
mir::Rvalue::Use(ref operand) => {
2827
let cg_operand = self.codegen_operand(&mut bx, operand);

Diff for: compiler/rustc_codegen_ssa/src/mir/statement.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use crate::traits::BuilderMethods;
66
use crate::traits::*;
77

88
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
9+
#[instrument(level = "debug", skip(self, bx))]
910
pub fn codegen_statement(&mut self, mut bx: Bx, statement: &mir::Statement<'tcx>) -> Bx {
10-
debug!("codegen_statement(statement={:?})", statement);
11-
1211
self.set_debug_loc(&mut bx, statement.source_info);
1312
match statement.kind {
1413
mir::StatementKind::Assign(box (ref place, ref rvalue)) => {

Diff for: compiler/rustc_mir_build/src/thir/cx/expr.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ impl<'tcx> Cx<'tcx> {
3232
exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
3333
}
3434

35+
#[instrument(level = "debug", skip(self, hir_expr))]
3536
pub(super) fn mirror_expr_inner(&mut self, hir_expr: &'tcx hir::Expr<'tcx>) -> ExprId {
3637
let temp_lifetime =
3738
self.rvalue_scopes.temporary_scope(self.region_scope_tree, hir_expr.hir_id.local_id);
3839
let expr_scope =
3940
region::Scope { id: hir_expr.hir_id.local_id, data: region::ScopeData::Node };
4041

41-
debug!("Expr::make_mirror(): id={}, span={:?}", hir_expr.hir_id, hir_expr.span);
42+
debug!(?hir_expr.hir_id, ?hir_expr.span);
4243

4344
let mut expr = self.make_mirror_unadjusted(hir_expr);
4445

@@ -49,7 +50,7 @@ impl<'tcx> Cx<'tcx> {
4950

5051
// Now apply adjustments, if any.
5152
for adjustment in self.typeck_results.expr_adjustments(hir_expr) {
52-
debug!("make_mirror: expr={:?} applying adjustment={:?}", expr, adjustment);
53+
trace!(?expr, ?adjustment);
5354
let span = expr.span;
5455
expr =
5556
self.apply_adjustment(hir_expr, expr, adjustment, adjustment_span.unwrap_or(span));

0 commit comments

Comments
 (0)