File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ use syntax::symbol::keywords;
31
31
use syntax:: abi:: Abi ;
32
32
33
33
use std:: iter;
34
- use std:: ffi:: CString ;
35
34
36
35
use rustc_data_structures:: bitvec:: BitVector ;
37
36
use rustc_data_structures:: indexed_vec:: { IndexVec , Idx } ;
@@ -218,17 +217,10 @@ pub fn trans_mir<'a, 'tcx: 'a>(
218
217
// Allocate a `Block` for every basic block
219
218
let block_bcxs: IndexVec < mir:: BasicBlock , BasicBlockRef > =
220
219
mir. basic_blocks ( ) . indices ( ) . map ( |bb| {
221
- let name = if bb == mir:: START_BLOCK {
222
- CString :: new ( "start" ) . unwrap ( )
220
+ if bb == mir:: START_BLOCK {
221
+ bcx . build_new_block ( "start" ) . llbb ( )
223
222
} else {
224
- CString :: new ( format ! ( "{:?}" , bb) ) . unwrap ( )
225
- } ;
226
- unsafe {
227
- llvm:: LLVMAppendBasicBlockInContext (
228
- ccx. llcx ( ) ,
229
- llfn,
230
- name. as_ptr ( )
231
- )
223
+ bcx. build_new_block ( & format ! ( "{:?}" , bb) ) . llbb ( )
232
224
}
233
225
} ) . collect ( ) ;
234
226
You can’t perform that action at this time.
0 commit comments