about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-06-07 09:25:14 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-07-28 16:14:58 +0200
commitdce1c61e977deed5e0a499f4247d5da870809692 (patch)
tree7fff58a51ee7955ca8df32f0a340397c770d7cd7 /src/rustllvm/RustWrapper.cpp
parentd3d552b71b89633fe6692bf2214a2d001683bfa9 (diff)
downloadrust-dce1c61e977deed5e0a499f4247d5da870809692.tar.gz
rust-dce1c61e977deed5e0a499f4247d5da870809692.zip
Add dropflag hints (stack-local booleans) for unfragmented paths in trans.
Added code to maintain these hints at runtime, and to conditionalize
drop-filling and calls to destructors.

In this early stage, we are using hints, so we are always free to
leave out a flag for a path -- then we just pass `None` as the
dropflag hint in the corresponding schedule cleanup call. But, once a
path has a hint, we must at least maintain it: i.e. if the hint
exists, we must ensure it is never set to "moved" if the data in
question might actually have been initialized. It remains sound to
conservatively set the hint to "initialized" as long as the true
drop-flag embedded in the value itself is up-to-date.

----

Here are some high-level details I want to point out:

 * We maintain the hint in Lvalue::post_store, marking the lvalue as
   moved. (But also continue drop-filling if necessary.)

 * We update the hint on ExprAssign.

 * We pass along the hint in once closures that capture-by-move.

 * You only call `drop_ty` for state that does not have an associated hint.
   If you have a hint, you must call `drop_ty_core` instead.
   (Originally I passed the hint into `drop_ty` as well, to make the
   connection to a hint more apparent, but the vast majority of
   current calls to `drop_ty` are in contexts where no hint is
   available, so it just seemed like noise in the resulting diff.)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions