1
Fork 0

codegen_llvm: improve allocations

This commit is contained in:
ljedrz 2018-10-08 16:55:04 +02:00
parent 61f47737b5
commit cd41765851
4 changed files with 26 additions and 14 deletions

View file

@ -52,8 +52,9 @@ fn require_inited() {
}
unsafe fn configure_llvm(sess: &Session) {
let mut llvm_c_strs = Vec::new();
let mut llvm_args = Vec::new();
let n_args = sess.opts.cg.llvm_args.len();
let mut llvm_c_strs = Vec::with_capacity(n_args + 1);
let mut llvm_args = Vec::with_capacity(n_args + 1);
{
let mut add = |arg: &str| {