Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup old trans #38302

Merged
merged 103 commits into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
bf7d453
Refactor Block into BlockAndBuilder
Mark-Simulacrum Dec 11, 2016
3f17ab9
Remove unreachable and terminated from Block
Mark-Simulacrum Dec 11, 2016
59ef51c
Replace build.rs with calling functions on builder directly
Mark-Simulacrum Dec 11, 2016
e77d928
Add notes regarding malloc_raw_dyn being unwind incompatible
Mark-Simulacrum Dec 11, 2016
ad0a901
Remove *_builder
Mark-Simulacrum Dec 11, 2016
fec59c5
Replace lpad().and_then(..) with None
Mark-Simulacrum Dec 11, 2016
3dbd141
Remove unused map_block
Mark-Simulacrum Dec 12, 2016
8f3d824
Remove common::Block.
Mark-Simulacrum Dec 12, 2016
86b2bdb
Rename LandingPad to Funclet
Mark-Simulacrum Dec 12, 2016
ed989d3
Simple cleanups/inlines in cleanup
Mark-Simulacrum Dec 12, 2016
5a36f88
Remove debug_loc from CleanupScope and privatize various helpers
Mark-Simulacrum Dec 12, 2016
ec518a0
Remove EarlyExitLabel, it only has one variant and is as such useless
Mark-Simulacrum Dec 12, 2016
2842912
Remove DropValue.is_immediate
Mark-Simulacrum Dec 12, 2016
48715a1
Reformatting
Mark-Simulacrum Dec 12, 2016
da971b7
Pull out get_or_create landing pad to avoid issues with dynamic borro…
Mark-Simulacrum Dec 12, 2016
85ef02d
Only one DropValue per CleanupScope
Mark-Simulacrum Dec 13, 2016
6412f31
Propagate CleanupScope::needs_invoke being always true
Mark-Simulacrum Dec 13, 2016
91707dc
Merge need_invoke and needs_invoke
Mark-Simulacrum Dec 13, 2016
51dfba1
Refactor Vec<CleanupScope> into Option<CleanupScope>.
Mark-Simulacrum Dec 13, 2016
28d00e7
Remove cleanup scope from FunctionContext
Mark-Simulacrum Dec 14, 2016
cd57bbe
Refactor get_landing_pad to take a CleanupScope
Mark-Simulacrum Dec 14, 2016
3265afa
Inline and simplify Callee::call duplicates.
Mark-Simulacrum Dec 14, 2016
6441c97
Remove push_ctxt
Mark-Simulacrum Dec 15, 2016
6710af3
Slightly simplify tvec::slice_for_each
Mark-Simulacrum Dec 15, 2016
3169169
Deduplicate store_operand_direct and store_operand
Mark-Simulacrum Dec 15, 2016
c7f8b0c
Eagerly evaluate landing pads for cleanup scopes
Mark-Simulacrum Dec 15, 2016
b10d89a
Move around code in cleanup for a more logical ordering, and fix comm…
Mark-Simulacrum Dec 15, 2016
14ae76d
Unbox FunctionDebugContextData.
Mark-Simulacrum Dec 15, 2016
dda6c8c
Inline base::malloc_raw_dyn.
Mark-Simulacrum Dec 16, 2016
5bdcc22
Remove FIXME
Mark-Simulacrum Dec 16, 2016
da23332
Remove remaining traces of block_arena
Mark-Simulacrum Dec 16, 2016
e0ccc81
Remove needless allows
Mark-Simulacrum Dec 16, 2016
28f511c
Remove global Builder
Mark-Simulacrum Dec 16, 2016
bc0b172
Remove BlockAndBuilder.funclet
Mark-Simulacrum Dec 16, 2016
be981dc
Start FunctionContext privatization and reduction
Mark-Simulacrum Dec 16, 2016
8201645
Remove DebugLoc.
Mark-Simulacrum Dec 16, 2016
5262113
Remove fcx.span
Mark-Simulacrum Dec 16, 2016
bf8614b
Rename Builder::alloca to dynamic_alloca
Mark-Simulacrum Dec 16, 2016
cbbdb73
Remove FunctionContext::cleanup, replacing it with a Drop impl.
Mark-Simulacrum Dec 16, 2016
c4f6173
Replace init with get_entry_block.
Mark-Simulacrum Dec 16, 2016
8ed1120
Minor cleanup to context
Mark-Simulacrum Dec 16, 2016
755850f
Merge OwnedBuilder and Builder
Mark-Simulacrum Dec 17, 2016
85ab080
Remove global builder
Mark-Simulacrum Dec 17, 2016
05d107d
Inline validate_substs
Mark-Simulacrum Dec 17, 2016
65f0400
Remove FunctionContext.landingpad_alloca.
Mark-Simulacrum Dec 17, 2016
9c38a54
Inline FunctionContext.mir
Mark-Simulacrum Dec 17, 2016
cc1e210
Inline trans_exchange_free
Mark-Simulacrum Dec 17, 2016
449c6d8
Simplify basic_block.rs
Mark-Simulacrum Dec 17, 2016
88b2024
Cleanup instruction counting
Mark-Simulacrum Dec 17, 2016
21bd747
Remove unused functions in abi
Mark-Simulacrum Dec 17, 2016
9a19853
Remove unused imports
Mark-Simulacrum Dec 17, 2016
937001a
Refactor Callee::call to take bcx by-reference.
Mark-Simulacrum Dec 17, 2016
1804131
Remove Ref::clone for MirContext mir
Mark-Simulacrum Dec 17, 2016
f051c60
Reduce extensions to FunctionContext in cleanup.
Mark-Simulacrum Dec 17, 2016
c693bcc
Inline memfill and merge with memset_intrinsic.
Mark-Simulacrum Dec 17, 2016
611e90b
Simplify intrinsic match statement
Mark-Simulacrum Dec 17, 2016
99816a6
Further simplify intrinsic matching
Mark-Simulacrum Dec 18, 2016
b48e74b
Rename 'blk and 'bcx to 'a
Mark-Simulacrum Dec 18, 2016
515d14f
Inline/Replace finish with build_return_block
Mark-Simulacrum Dec 18, 2016
97a2096
Inline and cleanup build_return_block
Mark-Simulacrum Dec 18, 2016
1173db0
Inline last remaining use of Callee::call and delete unused code
Mark-Simulacrum Dec 18, 2016
a802b9f
Inline get_funclet
Mark-Simulacrum Dec 18, 2016
fc8c280
Remove lifetime parameter
Mark-Simulacrum Dec 18, 2016
2b9a0ef
Move debug_context to MirContext from FunctionContext
Mark-Simulacrum Dec 18, 2016
a42a342
Move param_env onto SharedCrateContext, and move functions which need…
Mark-Simulacrum Dec 18, 2016
e10695f
Move param_substs onto MirContext
Mark-Simulacrum Dec 18, 2016
0a71b38
Remove llretslotptr from FunctionContext
Mark-Simulacrum Dec 18, 2016
4c7041e
Don't special case abort/unreachable intrinsics
Mark-Simulacrum Dec 18, 2016
2bda3b7
Inline and simplify init_cpad
Mark-Simulacrum Dec 19, 2016
63a0d85
Make add_incoming_to_phi call slightly less confusing.
Mark-Simulacrum Dec 19, 2016
f9f1406
Rebase fixes
Mark-Simulacrum Dec 19, 2016
6e3d8cd
Fix and cleanup callee shims
Mark-Simulacrum Dec 19, 2016
dd1890f
Remove unreachable call to unreachable
Mark-Simulacrum Dec 19, 2016
7f5dffb
Make debuginfo take debug_context instead of MirContext
Mark-Simulacrum Dec 19, 2016
a445199
Remove public ccx function on MirContext
Mark-Simulacrum Dec 19, 2016
0256f60
Move debug info check into create_function_debug_context
Mark-Simulacrum Dec 19, 2016
5301d38
Remove unused bcx from LocalAnalyzer.
Mark-Simulacrum Dec 19, 2016
7f87163
Simplify funclets creation.
Mark-Simulacrum Dec 19, 2016
5ef85dd
Change param_env to empty_param_env
Mark-Simulacrum Dec 19, 2016
22bf541
Clean up uses of set_personality_fn.
Mark-Simulacrum Dec 19, 2016
f11721a
Add helper function to set debug locations
Mark-Simulacrum Dec 19, 2016
f103ea4
Remove unecessary logic.
Mark-Simulacrum Dec 19, 2016
88202c5
Replace bcx.ccx() with bcx.ccx
Mark-Simulacrum Dec 19, 2016
15c9e5e
Mutate llargs instead of reconstructing it.
Mark-Simulacrum Dec 20, 2016
6fac0a1
Change *.fcx.ccx to *.ccx
Mark-Simulacrum Dec 20, 2016
d55e739
Do not use BAB after calling unreachable.
Mark-Simulacrum Dec 20, 2016
6f368e6
Use fn_ty directly
Mark-Simulacrum Dec 20, 2016
0d5a8ad
Move get_landing_pad onto DropVal.
Mark-Simulacrum Dec 20, 2016
6a1ec55
Remove needless check
Mark-Simulacrum Dec 20, 2016
b9f1064
Inline make_drop_glue
Mark-Simulacrum Dec 20, 2016
98a13ff
Remove outdated comment
Mark-Simulacrum Dec 20, 2016
295ea0d
Reduce coerce_unsized_into to one call
Mark-Simulacrum Dec 20, 2016
15b9b27
slice_for_each gives a reference already
Mark-Simulacrum Dec 20, 2016
bd009dc
Remove fn_ty from FunctionContext
Mark-Simulacrum Dec 20, 2016
3198797
Remove outdated comment
Mark-Simulacrum Dec 20, 2016
57914f6
Move eh_personality() onto CrateContext
Mark-Simulacrum Dec 20, 2016
07cf2a9
Simplify callee by removing is_indirect branch.
Mark-Simulacrum Dec 20, 2016
654131c
Add unreachable() after calls to eh_unwind_resume.
Mark-Simulacrum Dec 20, 2016
a811f60
Simplify get_landing_pad by inlining UnwindKind.
Mark-Simulacrum Dec 20, 2016
a9b5c63
Move eh_unwind_resume into CrateContext
Mark-Simulacrum Dec 20, 2016
c1bc5e5
Improve cache quality for eh_personality.
Mark-Simulacrum Dec 20, 2016
079abd0
Reuse cleanup pad declared at start of block.
Mark-Simulacrum Dec 20, 2016
0013d4c
Fix rebase errors.
Mark-Simulacrum Dec 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/liballoc/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub fn usable_size(size: usize, align: usize) -> usize {
pub const EMPTY: *mut () = 0x1 as *mut ();

/// The allocator for unique pointers.
// This function must not unwind. If it does, MIR trans will fail.
#[cfg(not(test))]
#[lang = "exchange_malloc"]
#[inline]
Expand Down
1 change: 1 addition & 0 deletions src/librustc_llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ extern "C" {

// Operations on instructions
pub fn LLVMGetInstructionParent(Inst: ValueRef) -> BasicBlockRef;
pub fn LLVMGetFirstBasicBlock(Fn: ValueRef) -> BasicBlockRef;
pub fn LLVMGetFirstInstruction(BB: BasicBlockRef) -> ValueRef;
pub fn LLVMInstructionEraseFromParent(Inst: ValueRef);

Expand Down
21 changes: 5 additions & 16 deletions src/librustc_trans/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use llvm::{self, ValueRef, Integer, Pointer, Float, Double, Struct, Array, Vector, AttributePlace};
use base;
use build::AllocaFcx;
use common::{type_is_fat_ptr, BlockAndBuilder, C_uint};
use context::CrateContext;
use cabi_x86;
Expand Down Expand Up @@ -99,21 +98,11 @@ impl ArgAttributes {
self
}

pub fn unset(&mut self, attr: ArgAttribute) -> &mut Self {
self.regular = self.regular - attr;
self
}

pub fn set_dereferenceable(&mut self, bytes: u64) -> &mut Self {
self.dereferenceable_bytes = bytes;
self
}

pub fn unset_dereferenceable(&mut self) -> &mut Self {
self.dereferenceable_bytes = 0;
self
}

pub fn apply_llfn(&self, idx: AttributePlace, llfn: ValueRef) {
unsafe {
self.regular.for_each_kind(|attr| attr.apply_llfn(idx, llfn));
Expand Down Expand Up @@ -246,7 +235,7 @@ impl ArgType {
if self.is_ignore() {
return;
}
let ccx = bcx.ccx();
let ccx = bcx.ccx;
if self.is_indirect() {
let llsz = llsize_of(ccx, self.ty);
let llalign = llalign_of_min(ccx, self.ty);
Expand Down Expand Up @@ -278,7 +267,7 @@ impl ArgType {
// bitcasting to the struct type yields invalid cast errors.

// We instead thus allocate some scratch space...
let llscratch = AllocaFcx(bcx.fcx(), ty, "abi_cast");
let llscratch = bcx.fcx().alloca(ty, "abi_cast");
base::Lifetime::Start.call(bcx, llscratch);

// ...where we first store the value...
Expand Down Expand Up @@ -431,7 +420,7 @@ impl FnType {
let ret_ty = sig.output();
let mut ret = arg_of(ret_ty, true);

if !type_is_fat_ptr(ccx.tcx(), ret_ty) {
if !type_is_fat_ptr(ccx, ret_ty) {
// The `noalias` attribute on the return value is useful to a
// function ptr caller.
if let ty::TyBox(_) = ret_ty.sty {
Expand Down Expand Up @@ -496,7 +485,7 @@ impl FnType {
for ty in inputs.iter().chain(extra_args.iter()) {
let mut arg = arg_of(ty, false);

if type_is_fat_ptr(ccx.tcx(), ty) {
if type_is_fat_ptr(ccx, ty) {
let original_tys = arg.original_ty.field_types();
let sizing_tys = arg.ty.field_types();
assert_eq!((original_tys.len(), sizing_tys.len()), (2, 2));
Expand Down Expand Up @@ -569,7 +558,7 @@ impl FnType {
};
// Fat pointers are returned by-value.
if !self.ret.is_ignore() {
if !type_is_fat_ptr(ccx.tcx(), sig.output()) {
if !type_is_fat_ptr(ccx, sig.output()) {
fixup(&mut self.ret);
}
}
Expand Down
Loading