about summary refs log tree commit diff
path: root/src/rt/rust_cc.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-09-21 12:40:27 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-09-23 11:09:57 +0200
commit420484579dee03d9b306a45a2fd005d3305206b1 (patch)
treea35e7788c0d76d75ae725f9a0735fc566df5dcf8 /src/rt/rust_cc.cpp
parentb029789f02b43772fe53d6ec040cf5ad4400d10c (diff)
downloadrust-420484579dee03d9b306a45a2fd005d3305206b1.tar.gz
rust-420484579dee03d9b306a45a2fd005d3305206b1.zip
Better handling of unreachable code in trans
The builder functions in trans_build now look at an 'unreachable' flag
in the block context and don't generate code (returning undefined
placeholder values) when this flag is set. Threading the unreachable
flag through context still requires some care, but this seems a more
sane approach than re-checking for terminated blocks throughout the
compiler.

When creating a block, if you use its closest dominator as parent, the
flag will be automatically passed through. If you can't do that,
because the dominator is a scope block that you're trying to get out
of, you'll have to do something like this to explicitly pass on the
flag:

    if bcx.unreachable { Unreachable(next_cx); }

Closes #949. Closes #946. Closes #942. Closes #895. Closes #894.
Closes #892. Closes #957. Closes #958.
Diffstat (limited to 'src/rt/rust_cc.cpp')
0 files changed, 0 insertions, 0 deletions