about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2013-07-21 16:19:34 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2013-07-21 18:29:20 +0200
commit205baa6ca2272e21032f8fb5477edefe4120bcbc (patch)
tree1ee4a81ac2e4955f103e1782f47d2f8313e449ea /src/rt/rust_kernel.cpp
parent565a9bf20b726c5182a6c4c816c1d9a4108c778a (diff)
downloadrust-205baa6ca2272e21032f8fb5477edefe4120bcbc.tar.gz
rust-205baa6ca2272e21032f8fb5477edefe4120bcbc.zip
Avoid blocks for static allocas and loading the closure environment
These blocks were required because previously we could only insert
instructions at the end of blocks, but we wanted to have all allocas in
one place, so they can be collapse. But now we have "direct" access the
the LLVM IR builder and can position it freely. This allows us to use
the same trick that clang uses, which means that we insert a dummy
"marker" instruction to identify the spot at which we want to insert
allocas. We can then later position the IR builder at that spot and
insert the alloca instruction, without any dedicated block.

The block for loading the closure environment can now also go away,
because the function context now provides the toplevel block, and the
translation of the loading happens first, so that's good enough.

Makes the LLVM IR a bit more readable, saving a bunch of branches in the
unoptimized code, which benefits unoptimized builds.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions