On 06/24/2013 07:28 PM, Graydon Hoare wrote:
On 13-06-24 09:10 AM, Michael Woerister wrote:
This still leaves open the question of internal runtime structures, such
as heap boxes, vecs, and possibly pointers.
Unsafe and region pointers seem to be regular machine-word sized values,
but I think I read somewhere that some pointers (to traits? something
about sized-types?) included an additional word. If somebody can easily
point me to some document or specific source code describing this, that
would be great.
If not, it's OK too, I can always find out by looking into the generated
LLVM bitcode :-)
Sure. It's not entirely obvious. The main places to look are:
src/rt/rust_type.h -- types used by C++ code, that LLVM-code matches
src/rt/rust_util.h -- more types used by C++ code
src/librustc/back/abi.rs -- *_field_* GEP-displacements of fields the
compiler knows about
src/librustc/middle/trans/adt.rs -- struct/tuple representations
src/librustc/middle/trans/type_.rs -- LLVM TypeRef wrapper: Type
src/librustc/middle/trans/type_of.rs -- lowers ty::t -> Type
If you have more specific questions, please ask more either here or on
IRC. And don't hesitate to file bugs or do cleanup while you're in
there. The compiler needs a lot of tidying-up its internals.
-Graydon
Thanks, this is very helpful. It had already stumbled upon rust_type.h,
but rust_util.h and back/abi.rs are new to me.
Regarding code cleanup, I've kept to trans/debuginfo.rs so far. However,
as my understanding of the trans module gets better, I certainly plan to
help out where I can.
-Michael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev