Skip to content

Commit

Permalink
Use 2PB less in rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Nov 28, 2018
1 parent a40646c commit 75808c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/librustc_codegen_llvm/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
OperandValue::Ref(next(), Some(next()), self.layout.align.abi).store(bx, dst);
}
PassMode::Direct(_) | PassMode::Indirect(_, None) | PassMode::Cast(_) => {
self.store(bx, next(), dst);
let next_param = next();
self.store(bx, next_param, dst);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/librustc_mir/transform/add_retag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl MirPass for AddRetag {
let src_ty = src.ty(&*local_decls, tcx);
if src_ty.is_region_ptr() {
// The only `Misc` casts on references are those creating raw pointers.
let src = src.clone();
assert!(dest_ty.is_unsafe_ptr());
// Insert escape-to-raw before the cast. We are not concerned
// with stability here: Our EscapeToRaw will not change the value
Expand All @@ -184,7 +185,7 @@ impl MirPass for AddRetag {
let source_info = block_data.statements[i].source_info;
block_data.statements.insert(i, Statement {
source_info,
kind: StatementKind::EscapeToRaw(src.clone()),
kind: StatementKind::EscapeToRaw(src),
});
}
}
Expand All @@ -194,9 +195,10 @@ impl MirPass for AddRetag {
StatementKind::Assign(ref place, _) if needs_retag(place) => {
// Insert a retag after the assignment.
let source_info = block_data.statements[i].source_info;
let place = place.clone();
block_data.statements.insert(i+1, Statement {
source_info,
kind: StatementKind::Retag { fn_entry: false, place: place.clone() },
kind: StatementKind::Retag { fn_entry: false, place },
});
}
// Do nothing for the rest
Expand Down

0 comments on commit 75808c9

Please sign in to comment.