Skip to content

Commit b5e3d83

Browse files
committed
---
yaml --- r: 92671 b: refs/heads/auto c: a07cee2 h: refs/heads/master i: 92669: 3c5d8b9 92667: efa6bc1 92663: 6b00b61 92655: af2da82 92639: 12f6412 92607: d235bcf 92543: e09d1ae 92415: 2346b5d 92159: 166798c v: v3
1 parent 82d82c7 commit b5e3d83

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 5b0401f0e8a60649c7e86cdb6ecdae0afc2f67ab
16+
refs/heads/auto: a07cee26a43024867d4b554b996bb5fc881dcb32
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ pub fn alloca_maybe_zeroed(cx: @Block, ty: Type, name: &str, zero: bool) -> Valu
15941594
let p = Alloca(cx, ty, name);
15951595
if zero {
15961596
let b = cx.fcx.ccx.builder();
1597-
b.position_before(cx.fcx.alloca_insert_pt.unwrap());
1597+
b.position_before(cx.fcx.alloca_insert_pt.get().unwrap());
15981598
memzero(&b, p, ty);
15991599
}
16001600
p
@@ -1687,7 +1687,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
16871687
},
16881688
llretptr: Cell::new(None),
16891689
entry_bcx: None,
1690-
alloca_insert_pt: None,
1690+
alloca_insert_pt: Cell::new(None),
16911691
llreturn: None,
16921692
llself: None,
16931693
personality: None,
@@ -1711,7 +1711,8 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
17111711
Load(entry_bcx, C_null(Type::i8p()));
17121712

17131713
fcx.entry_bcx = Some(entry_bcx);
1714-
fcx.alloca_insert_pt = Some(llvm::LLVMGetFirstInstruction(entry_bcx.llbb));
1714+
fcx.alloca_insert_pt.set(Some(
1715+
llvm::LLVMGetFirstInstruction(entry_bcx.llbb)));
17151716
}
17161717

17171718
if !ty::type_is_voidish(ccx.tcx, substd_output_type) {

branches/auto/src/librustc/middle/trans/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ pub fn Alloca(cx: &Block, Ty: Type, name: &str) -> ValueRef {
314314
unsafe {
315315
if cx.unreachable.get() { return llvm::LLVMGetUndef(Ty.ptr_to().to_ref()); }
316316
let b = cx.fcx.ccx.builder();
317-
b.position_before(cx.fcx.alloca_insert_pt.unwrap());
317+
b.position_before(cx.fcx.alloca_insert_pt.get().unwrap());
318318
b.alloca(Ty, name)
319319
}
320320
}
@@ -323,7 +323,7 @@ pub fn ArrayAlloca(cx: &Block, Ty: Type, Val: ValueRef) -> ValueRef {
323323
unsafe {
324324
if cx.unreachable.get() { return llvm::LLVMGetUndef(Ty.ptr_to().to_ref()); }
325325
let b = cx.fcx.ccx.builder();
326-
b.position_before(cx.fcx.alloca_insert_pt.unwrap());
326+
b.position_before(cx.fcx.alloca_insert_pt.get().unwrap());
327327
b.array_alloca(Ty, Val)
328328
}
329329
}

branches/auto/src/librustc/middle/trans/common.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pub struct FunctionContext {
221221
// the function, due to LLVM's quirks.
222222
// A marker for the place where we want to insert the function's static
223223
// allocas, so that LLVM will coalesce them into a single alloca call.
224-
alloca_insert_pt: Option<ValueRef>,
224+
alloca_insert_pt: Cell<Option<ValueRef>>,
225225
llreturn: Option<BasicBlockRef>,
226226
// The 'self' value currently in use in this function, if there
227227
// is one.
@@ -291,7 +291,9 @@ impl FunctionContext {
291291

292292
pub fn cleanup(&mut self) {
293293
unsafe {
294-
llvm::LLVMInstructionEraseFromParent(self.alloca_insert_pt.unwrap());
294+
llvm::LLVMInstructionEraseFromParent(self.alloca_insert_pt
295+
.get()
296+
.unwrap());
295297
}
296298
// Remove the cycle between fcx and bcx, so memory can be freed
297299
self.entry_bcx = None;

0 commit comments

Comments
 (0)