Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Merge #91
Browse files Browse the repository at this point in the history
91: A handful of low-hanging fruit. r=ptersilie a=vext01

Here's some easy next steps.

See individual commits.

Co-authored-by: Edd Barrett <[email protected]>
  • Loading branch information
bors[bot] and vext01 authored Mar 13, 2020
2 parents 0388dc4 + e46b57a commit 2d93224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/librustc/sir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub struct SirFuncCx {

impl SirFuncCx {
pub fn new<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>, num_blocks: usize) -> Self {
let symbol_name = format!("new__{}", tcx.symbol_name(*instance).name.as_str());

let mut flags = 0;
for attr in tcx.get_attrs(instance.def_id()).iter() {
if attr.check_name(sym::trace_head) {
Expand All @@ -81,6 +79,7 @@ impl SirFuncCx {
num_blocks
];

let symbol_name = String::from(&*tcx.symbol_name(*instance).name.as_str());
Self { func: ykpack::Body { symbol_name, blocks, flags } }
}

Expand Down Expand Up @@ -109,6 +108,9 @@ impl SirFuncCx {
let assign = self.lower_assign_stmt(place, rvalue);
self.push_stmt(bb, assign);
}
mir::StatementKind::StorageLive(..) | mir::StatementKind::StorageDead(..) => {
// Ignore. Tracer doesn't need to know about these.
}
_ => self.push_stmt(bb, ykpack::Statement::Unimplemented(format!("{:?}", stmt))),
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_codegen_ssa/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

mir::TerminatorKind::Return => {
self.codegen_return_terminator(bx);
set_unimplemented_sir_term!(self, bb, terminator);
if let Some(sfcx) = &mut self.sir_func_cx {
sfcx.set_terminator(bb.as_u32(), ykpack::Terminator::Return);
}
}

mir::TerminatorKind::Unreachable => {
Expand Down

0 comments on commit 2d93224

Please sign in to comment.