rustc: improve -Z trans-stats to report per-fn LLVM instruction counts and translation timing
remove extra::rope

It's broken/unmaintained and needs to be rewritten to avoid managed
pointers and needless copies. A full rewrite is necessary and the API
will need to be redone so it's not worth keeping this around.

Closes #2236, #2744
Implement scopes independent of LLVM basic blocks

Currently, scopes are tied to LLVM basic blocks. For each scope, there
are two new basic blocks, which means two extra jumps in the unoptimized
IR. These blocks aren't actually required, but only used to act as the
boundary for cleanups.

By keeping track of the current scope within a single basic block, we
can avoid those extra blocks and jumps, shrinking the pre-optimization
IR quite considerably. For example, the IR for trans_intrinsic goes
from ~22k lines to ~16k lines, almost 30% less.

The impact on the build times of optimized builds is rather small (about
1%), but unoptimized builds are about 11% faster. The testsuite for
unoptimized builds runs between 15% (CPU time) and 7.5% (wallclock time on
my i7) faster.

Also, in some situations this helps LLVM to generate better code by
inlining functions that it previously considered to be too large.
Likely because of the pointless blocks/jumps that were still present at
the time the inlining pass runs.

Refs #7462
auto merge of #7636 : dotdash/rust/scope_cleanup, r=graydon

Currently, scopes are tied to LLVM basic blocks. For each scope, there
are two new basic blocks, which means two extra jumps in the unoptimized
IR. These blocks aren't actually required, but only used to act as the
boundary for cleanups.

By keeping track of the current scope within a single basic block, we
can avoid those extra blocks and jumps, shrinking the pre-optimization
IR quite considerably. For example, the IR for trans_intrinsic goes
from ~22k lines to ~16k lines, almost 30% less.

The impact on the build times of optimized builds is rather small (about
1%), but unoptimized builds are about 11% faster. The testsuite for
unoptimized builds runs between 15% (CPU time) and 7.5% (wallclock time on
my i7) faster.

Also, in some situations this helps LLVM to generate better code by
inlining functions that it previously considered to be too large.
Likely because of the pointless blocks/jumps that were still present at
the time the inlining pass runs.

Refs #7462
auto merge of #7456 : graydon/rust/better-trans-stats, r=cmr

This way when you compile with -Z trans-stats you'll get a per-function cost breakdown, sorted with the most expensive functions first. Should help highlight pathological code.
auto merge of #7629 : thestinger/rust/rope, r=graydon

It's broken/unmaintained and needs to be rewritten to avoid managed
pointers and needless copies. A full rewrite is necessary and the API
will need to be redone so it's not worth keeping this around (#7628).

Closes #2236, #2744
rustc: remove some dead functions
std: add str.to_c_str()
std: rename str.as_bytes_with_null_consume() to str.to_bytes()
std: rewrite run::with_{argv,envp,dirp} to copy C strings
std: remove os::as_c_charp
std: move str::as_buf into StrSlice
std: move str::as_c_str into StrSlice
std: remove str::NullTerminatedStr
std: cleanup os and str tests
std: add test for str::as_c_str
std and extra: use as_c_str instead of as_buf in a couple places
std: rename str.as_buf to as_imm_buf, add str.as_mut_buf
std: remove str::to_owned and str::raw::slice_bytes_owned
std: remove a malloc from os::fill_charp_buf