Some tracing cleanups
This commit is contained in:
parent
493c960a3e
commit
0e674b3ec5
@ -28,7 +28,7 @@
|
||||
use std::iter;
|
||||
use std::ops::Deref;
|
||||
use std::ptr;
|
||||
use tracing::debug;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
// All Builders must have an llfn associated with them
|
||||
#[must_use]
|
||||
@ -464,15 +464,15 @@ fn atomic_load(
|
||||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn load_operand(&mut self, place: PlaceRef<'tcx, &'ll Value>) -> OperandRef<'tcx, &'ll Value> {
|
||||
debug!("PlaceRef::load: {:?}", place);
|
||||
|
||||
assert_eq!(place.llextra.is_some(), place.layout.is_unsized());
|
||||
|
||||
if place.layout.is_zst() {
|
||||
return OperandRef::new_zst(self, place.layout);
|
||||
}
|
||||
|
||||
#[instrument(level = "trace", skip(bx))]
|
||||
fn scalar_load_metadata<'a, 'll, 'tcx>(
|
||||
bx: &mut Builder<'a, 'll, 'tcx>,
|
||||
load: &'ll Value,
|
||||
|
@ -1623,7 +1623,7 @@ pub fn LLVMRustBuildIntCast<'a>(
|
||||
B: &Builder<'a>,
|
||||
Val: &'a Value,
|
||||
DestTy: &'a Type,
|
||||
IsSized: bool,
|
||||
IsSigned: bool,
|
||||
) -> &'a Value;
|
||||
|
||||
// Comparisons
|
||||
|
@ -204,6 +204,7 @@ pub fn project_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
}
|
||||
|
||||
/// Obtain the actual discriminant of a value.
|
||||
#[instrument(level = "trace", skip(bx))]
|
||||
pub fn codegen_get_discr<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
self,
|
||||
bx: &mut Bx,
|
||||
@ -420,12 +421,12 @@ pub fn storage_dead<Bx: BuilderMethods<'a, 'tcx, Value = V>>(&self, bx: &mut Bx)
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
#[instrument(level = "debug", skip(self, bx))]
|
||||
pub fn codegen_place(
|
||||
&mut self,
|
||||
bx: &mut Bx,
|
||||
place_ref: mir::PlaceRef<'tcx>,
|
||||
) -> PlaceRef<'tcx, Bx::Value> {
|
||||
debug!("codegen_place(place_ref={:?})", place_ref);
|
||||
let cx = self.cx;
|
||||
let tcx = self.cx.tcx();
|
||||
|
||||
|
@ -15,14 +15,13 @@
|
||||
use rustc_target::abi::{Abi, Int, Variants};
|
||||
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
#[instrument(level = "debug", skip(self, bx))]
|
||||
pub fn codegen_rvalue(
|
||||
&mut self,
|
||||
mut bx: Bx,
|
||||
dest: PlaceRef<'tcx, Bx::Value>,
|
||||
rvalue: &mir::Rvalue<'tcx>,
|
||||
) -> Bx {
|
||||
debug!("codegen_rvalue(dest.llval={:?}, rvalue={:?})", dest.llval, rvalue);
|
||||
|
||||
match *rvalue {
|
||||
mir::Rvalue::Use(ref operand) => {
|
||||
let cg_operand = self.codegen_operand(&mut bx, operand);
|
||||
|
@ -6,9 +6,8 @@
|
||||
use crate::traits::*;
|
||||
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
#[instrument(level = "debug", skip(self, bx))]
|
||||
pub fn codegen_statement(&mut self, mut bx: Bx, statement: &mir::Statement<'tcx>) -> Bx {
|
||||
debug!("codegen_statement(statement={:?})", statement);
|
||||
|
||||
self.set_debug_loc(&mut bx, statement.source_info);
|
||||
match statement.kind {
|
||||
mir::StatementKind::Assign(box (ref place, ref rvalue)) => {
|
||||
|
@ -32,13 +32,14 @@ pub(crate) fn mirror_exprs(&mut self, exprs: &'tcx [hir::Expr<'tcx>]) -> Box<[Ex
|
||||
exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self, hir_expr))]
|
||||
pub(super) fn mirror_expr_inner(&mut self, hir_expr: &'tcx hir::Expr<'tcx>) -> ExprId {
|
||||
let temp_lifetime =
|
||||
self.rvalue_scopes.temporary_scope(self.region_scope_tree, hir_expr.hir_id.local_id);
|
||||
let expr_scope =
|
||||
region::Scope { id: hir_expr.hir_id.local_id, data: region::ScopeData::Node };
|
||||
|
||||
debug!("Expr::make_mirror(): id={}, span={:?}", hir_expr.hir_id, hir_expr.span);
|
||||
debug!(?hir_expr.hir_id, ?hir_expr.span);
|
||||
|
||||
let mut expr = self.make_mirror_unadjusted(hir_expr);
|
||||
|
||||
@ -49,7 +50,7 @@ pub(super) fn mirror_expr_inner(&mut self, hir_expr: &'tcx hir::Expr<'tcx>) -> E
|
||||
|
||||
// Now apply adjustments, if any.
|
||||
for adjustment in self.typeck_results.expr_adjustments(hir_expr) {
|
||||
debug!("make_mirror: expr={:?} applying adjustment={:?}", expr, adjustment);
|
||||
trace!(?expr, ?adjustment);
|
||||
let span = expr.span;
|
||||
expr =
|
||||
self.apply_adjustment(hir_expr, expr, adjustment, adjustment_span.unwrap_or(span));
|
||||
|
Loading…
Reference in New Issue
Block a user