Skip to content

Commit 8373250

Browse files
committed
---
yaml --- r: 56026 b: refs/heads/auto c: 3c08be9 h: refs/heads/master v: v3
1 parent a7ef4a5 commit 8373250

File tree

26 files changed

+341
-152
lines changed

26 files changed

+341
-152
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 2c649830be732bc0af585ba4ef54b2c6555b7c1c
17+
refs/heads/auto: 3c08be9b48f5a4413a35728a0c392df3b0bed785
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/librustc/front/core_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn inject_libcore_ref(sess: Session,
7777
fold_mod: |module, fld| {
7878
let n2 = sess.next_node_id();
7979

80-
let prelude_path = @ast::Path {
80+
let prelude_path = @ast::path {
8181
span: dummy_sp(),
8282
global: false,
8383
idents: ~[

branches/auto/src/librustc/front/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,16 @@ fn nospan<T:Copy>(t: T) -> codemap::spanned<T> {
336336
codemap::spanned { node: t, span: dummy_sp() }
337337
}
338338

339-
fn path_node(+ids: ~[ast::ident]) -> @ast::Path {
340-
@ast::Path { span: dummy_sp(),
339+
fn path_node(+ids: ~[ast::ident]) -> @ast::path {
340+
@ast::path { span: dummy_sp(),
341341
global: false,
342342
idents: ids,
343343
rp: None,
344344
types: ~[] }
345345
}
346346

347-
fn path_node_global(+ids: ~[ast::ident]) -> @ast::Path {
348-
@ast::Path { span: dummy_sp(),
347+
fn path_node_global(+ids: ~[ast::ident]) -> @ast::path {
348+
@ast::path { span: dummy_sp(),
349349
global: true,
350350
idents: ids,
351351
rp: None,

branches/auto/src/librustc/metadata/tydecode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn parse_arg_data(data: @~[u8], crate_num: int, pos: uint, tcx: ty::ctxt,
137137
parse_arg(st, conv)
138138
}
139139

140-
fn parse_path(st: @mut PState) -> @ast::Path {
140+
fn parse_path(st: @mut PState) -> @ast::path {
141141
let mut idents: ~[ast::ident] = ~[];
142142
fn is_last(c: char) -> bool { return c == '(' || c == ':'; }
143143
idents.push(parse_ident_(st, is_last));
@@ -146,7 +146,7 @@ fn parse_path(st: @mut PState) -> @ast::Path {
146146
':' => { next(st); next(st); }
147147
c => {
148148
if c == '(' {
149-
return @ast::Path { span: dummy_sp(),
149+
return @ast::path { span: dummy_sp(),
150150
global: false,
151151
idents: idents,
152152
rp: None,

branches/auto/src/librustc/middle/pat_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: @pat) -> bool {
7272
}
7373

7474
pub fn pat_bindings(dm: resolve::DefMap, pat: @pat,
75-
it: &fn(binding_mode, node_id, span, @Path)) {
75+
it: &fn(binding_mode, node_id, span, @path)) {
7676
do walk_pat(pat) |p| {
7777
match p.node {
7878
pat_ident(binding_mode, pth, _) if pat_is_binding(dm, p) => {

branches/auto/src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use syntax::ast::{decl_item, def, def_fn, def_id, def_static_method};
2626
use syntax::ast::{def_variant, expr_field, expr_method_call, expr_path};
2727
use syntax::ast::{expr_struct, expr_unary, ident, inherited, item_enum};
2828
use syntax::ast::{item_foreign_mod, item_fn, item_impl, item_struct};
29-
use syntax::ast::{item_trait, local_crate, node_id, pat_struct, Path};
29+
use syntax::ast::{item_trait, local_crate, node_id, pat_struct, path};
3030
use syntax::ast::{private, provided, public, required, stmt_decl, visibility};
3131
use syntax::ast;
3232
use syntax::ast_map::{node_foreign_item, node_item, node_method};
@@ -276,7 +276,7 @@ pub fn check_crate(tcx: ty::ctxt,
276276
};
277277

278278
// Checks that a private path is in scope.
279-
let check_path: @fn(span: span, def: def, path: @Path) =
279+
let check_path: @fn(span: span, def: def, path: @path) =
280280
|span, def, path| {
281281
debug!("checking path");
282282
match def {

branches/auto/src/librustc/middle/resolve.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use syntax::ast::{item_const, item_enum, item_fn, item_foreign_mod};
4848
use syntax::ast::{item_impl, item_mac, item_mod, item_trait, item_ty, le};
4949
use syntax::ast::{local, local_crate, lt, method, mode, mul};
5050
use syntax::ast::{named_field, ne, neg, node_id, pat, pat_enum, pat_ident};
51-
use syntax::ast::{Path, pat_lit, pat_range, pat_struct};
51+
use syntax::ast::{path, pat_lit, pat_range, pat_struct};
5252
use syntax::ast::{prim_ty, private, provided};
5353
use syntax::ast::{public, required, rem, self_ty_, shl, shr, stmt_decl};
5454
use syntax::ast::{struct_dtor, struct_field, struct_variant_kind};
@@ -4368,7 +4368,7 @@ pub impl Resolver {
43684368
/// If `check_ribs` is true, checks the local definitions first; i.e.
43694369
/// doesn't skip straight to the containing module.
43704370
fn resolve_path(@mut self,
4371-
path: @Path,
4371+
path: @path,
43724372
namespace: Namespace,
43734373
check_ribs: bool,
43744374
visitor: ResolveVisitor)
@@ -4493,7 +4493,7 @@ pub impl Resolver {
44934493
return NoNameDefinition;
44944494
}
44954495

4496-
fn intern_module_part_of_path(@mut self, path: @Path) -> ~[ident] {
4496+
fn intern_module_part_of_path(@mut self, path: @path) -> ~[ident] {
44974497
let mut module_path_idents = ~[];
44984498
for path.idents.eachi |index, ident| {
44994499
if index == path.idents.len() - 1 {
@@ -4507,7 +4507,7 @@ pub impl Resolver {
45074507
}
45084508

45094509
fn resolve_module_relative_path(@mut self,
4510-
path: @Path,
4510+
path: @path,
45114511
+xray: XrayFlag,
45124512
namespace: Namespace)
45134513
-> Option<def> {
@@ -4553,7 +4553,7 @@ pub impl Resolver {
45534553
/// Invariant: This must be called only during main resolution, not during
45544554
/// import resolution.
45554555
fn resolve_crate_relative_path(@mut self,
4556-
path: @Path,
4556+
path: @path,
45574557
+xray: XrayFlag,
45584558
namespace: Namespace)
45594559
-> Option<def> {

branches/auto/src/librustc/middle/trans/debuginfo.rs

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,23 @@ fn create_tuple(cx: @CrateContext, t: ty::t, elements: &[ty::t], span: span)
542542
return mdval;
543543
}
544544

545-
fn create_boxed_type(cx: @CrateContext, outer: ty::t, _inner: ty::t,
545+
// returns (void* type as a ValueRef, size in bytes, align in bytes)
546+
fn voidptr() -> (ValueRef, int, int) {
547+
let null = ptr::null();
548+
let size = sys::size_of::<ValueRef>() as int;
549+
let align = sys::min_align_of::<ValueRef>() as int;
550+
let vp = create_derived_type(PointerTypeTag, null, ~"", 0,
551+
size, align, 0, null);
552+
return (vp, size, align);
553+
}
554+
555+
fn create_boxed_type(cx: @CrateContext, contents: ty::t,
546556
span: span, boxed: @Metadata<TyDescMetadata>)
547557
-> @Metadata<TyDescMetadata> {
548558
//let tg = StructureTypeTag;
549559
/*let cache = cx.llmetadata;
550560
match cached_metadata::<@Metadata<TyDescMetadata>>(
551-
cache, tg, {|md| ty::hash_ty(outer) == ty::hash_ty(md.data.hash)}) {
561+
cache, tg, {|md| ty::hash_ty(contents) == ty::hash_ty(md.data.hash)}) {
552562
option::Some(md) { return md; }
553563
option::None {}
554564
}*/
@@ -557,18 +567,23 @@ fn create_boxed_type(cx: @CrateContext, outer: ty::t, _inner: ty::t,
557567
//let cu_node = create_compile_unit_metadata(cx, fname);
558568
let uint_t = ty::mk_uint(cx.tcx);
559569
let refcount_type = create_basic_type(cx, uint_t, span);
560-
let scx = create_structure(file_node,
561-
@/*bad*/ copy ty_to_str(cx.tcx, outer), 0);
570+
let name = ty_to_str(cx.tcx, contents);
571+
let scx = create_structure(file_node, @fmt!("box<%s>", name), 0);
562572
add_member(scx, ~"refcnt", 0, sys::size_of::<uint>() as int,
563573
sys::min_align_of::<uint>() as int, refcount_type.node);
564-
add_member(scx, ~"boxed", 0, 8, //XXX member_size_and_align(??)
565-
8, //XXX just a guess
566-
boxed.node);
574+
// the tydesc and other pointers should be irrelevant to the
575+
// debugger, so treat them as void* types
576+
let (vp, vpsize, vpalign) = voidptr();
577+
add_member(scx, ~"tydesc", 0, vpsize, vpalign, vp);
578+
add_member(scx, ~"prev", 0, vpsize, vpalign, vp);
579+
add_member(scx, ~"next", 0, vpsize, vpalign, vp);
580+
let (size, align) = size_and_align_of(cx, contents);
581+
add_member(scx, ~"boxed", 0, size, align, boxed.node);
567582
let llnode = finish_structure(scx);
568583
let mdval = @Metadata {
569584
node: llnode,
570585
data: TyDescMetadata {
571-
hash: ty::type_id(outer)
586+
hash: ty::type_id(contents)
572587
}
573588
};
574589
//update_cache(cache, tg, tydesc_metadata(mdval));
@@ -655,11 +670,10 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span)
655670
ty::ty_enum(_did, ref _substs) => {
656671
cx.sess.span_bug(span, ~"debuginfo for enum NYI")
657672
}
658-
ty::ty_box(ref _mt) => {
659-
cx.sess.span_bug(span, ~"debuginfo for box NYI")
660-
},
661-
ty::ty_uniq(ref _mt) => {
662-
cx.sess.span_bug(span, ~"debuginfo for uniq NYI")
673+
ty::ty_box(ref mt) | ty::ty_uniq(ref mt) => {
674+
let boxed = create_ty(cx, mt.ty, span);
675+
let box_md = create_boxed_type(cx, mt.ty, span, boxed);
676+
create_pointer_type(cx, t, span, box_md)
663677
},
664678
ty::ty_evec(ref _mt, ref _vstore) => {
665679
cx.sess.span_bug(span, ~"debuginfo for evec NYI")

branches/auto/src/librustc/middle/typeck/astconv.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn ast_path_substs<AC:AstConv,RS:region_scope + Copy + Durable>(
136136
def_id: ast::def_id,
137137
decl_generics: &ty::Generics,
138138
self_ty: Option<ty::t>,
139-
path: @ast::Path) -> ty::substs
139+
path: @ast::path) -> ty::substs
140140
{
141141
/*!
142142
*
@@ -188,7 +188,7 @@ pub fn ast_path_to_substs_and_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
188188
self: &AC,
189189
rscope: &RS,
190190
did: ast::def_id,
191-
path: @ast::Path) -> ty_param_substs_and_ty
191+
path: @ast::path) -> ty_param_substs_and_ty
192192
{
193193
let tcx = self.tcx();
194194
let ty::ty_param_bounds_and_ty {
@@ -206,7 +206,7 @@ pub fn ast_path_to_trait_ref<AC:AstConv,RS:region_scope + Copy + Durable>(
206206
rscope: &RS,
207207
trait_def_id: ast::def_id,
208208
self_ty: Option<ty::t>,
209-
path: @ast::Path) -> @ty::TraitRef
209+
path: @ast::path) -> @ty::TraitRef
210210
{
211211
let trait_def =
212212
self.get_trait_def(trait_def_id);
@@ -229,7 +229,7 @@ pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
229229
self: &AC,
230230
rscope: &RS,
231231
did: ast::def_id,
232-
path: @ast::Path)
232+
path: @ast::path)
233233
-> ty_param_substs_and_ty
234234
{
235235
// Look up the polytype of the item and then substitute the provided types
@@ -318,7 +318,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + Durable>(
318318
}
319319

320320
fn check_path_args(tcx: ty::ctxt,
321-
path: @ast::Path,
321+
path: @ast::path,
322322
flags: uint) {
323323
if (flags & NO_TPS) != 0u {
324324
if path.types.len() > 0u {

branches/auto/src/librustc/middle/typeck/check/_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub struct pat_ctxt {
9999
block_region: ty::Region, // Region for the block of the arm
100100
}
101101

102-
pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::Path,
102+
pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
103103
subpats: &Option<~[@ast::pat]>, expected: ty::t) {
104104

105105
// Typecheck the path.
@@ -234,7 +234,7 @@ pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::Path,
234234
/// `etc` is true if the pattern said '...' and false otherwise.
235235
pub fn check_struct_pat_fields(pcx: pat_ctxt,
236236
span: span,
237-
path: @ast::Path,
237+
path: @ast::path,
238238
fields: &[ast::field_pat],
239239
class_fields: ~[ty::field_ty],
240240
class_id: ast::def_id,
@@ -285,7 +285,7 @@ pub fn check_struct_pat_fields(pcx: pat_ctxt,
285285
}
286286

287287
pub fn check_struct_pat(pcx: pat_ctxt, pat_id: ast::node_id, span: span,
288-
expected: ty::t, path: @ast::Path,
288+
expected: ty::t, path: @ast::path,
289289
fields: &[ast::field_pat], etc: bool,
290290
class_id: ast::def_id, substitutions: &ty::substs) {
291291
let fcx = pcx.fcx;
@@ -326,7 +326,7 @@ pub fn check_struct_like_enum_variant_pat(pcx: pat_ctxt,
326326
pat_id: ast::node_id,
327327
span: span,
328328
expected: ty::t,
329-
path: @ast::Path,
329+
path: @ast::path,
330330
fields: &[ast::field_pat],
331331
etc: bool,
332332
enum_id: ast::def_id,

branches/auto/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,7 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt,
32113211
// Instantiates the given path, which must refer to an item with the given
32123212
// number of type parameters and type.
32133213
pub fn instantiate_path(fcx: @mut FnCtxt,
3214-
pth: @ast::Path,
3214+
pth: @ast::path,
32153215
tpt: ty_param_bounds_and_ty,
32163216
span: span,
32173217
node_id: ast::node_id,

branches/auto/src/libsyntax/ast.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub struct Lifetime {
113113
#[auto_encode]
114114
#[auto_decode]
115115
#[deriving(Eq)]
116-
pub struct Path {
116+
pub struct path {
117117
span: span,
118118
global: bool,
119119
idents: ~[ident],
@@ -301,10 +301,10 @@ pub enum pat_ {
301301
// which it is. The resolver determines this, and
302302
// records this pattern's node_id in an auxiliary
303303
// set (of "pat_idents that refer to nullary enums")
304-
pat_ident(binding_mode, @Path, Option<@pat>),
305-
pat_enum(@Path, Option<~[@pat]>), /* "none" means a * pattern where
304+
pat_ident(binding_mode, @path, Option<@pat>),
305+
pat_enum(@path, Option<~[@pat]>), /* "none" means a * pattern where
306306
* we don't bind the fields to names */
307-
pat_struct(@Path, ~[field_pat], bool),
307+
pat_struct(@path, ~[field_pat], bool),
308308
pat_tup(~[@pat]),
309309
pat_box(@pat),
310310
pat_uniq(@pat),
@@ -567,7 +567,7 @@ pub enum expr_ {
567567
expr_assign_op(binop, @expr, @expr),
568568
expr_field(@expr, ident, ~[@Ty]),
569569
expr_index(@expr, @expr),
570-
expr_path(@Path),
570+
expr_path(@path),
571571
expr_addr_of(mutability, @expr),
572572
expr_break(Option<ident>),
573573
expr_again(Option<ident>),
@@ -579,7 +579,7 @@ pub enum expr_ {
579579
expr_mac(mac),
580580
581581
// A struct literal expression.
582-
expr_struct(@Path, ~[field], Option<@expr>),
582+
expr_struct(@path, ~[field], Option<@expr>),
583583
584584
// A vector literal constructed from one repeated element.
585585
expr_repeat(@expr /* element */, @expr /* count */, mutability),
@@ -697,7 +697,7 @@ pub type mac = spanned<mac_>;
697697
#[auto_decode]
698698
#[deriving(Eq)]
699699
pub enum mac_ {
700-
mac_invoc_tt(@Path,~[token_tree]), // new macro-invocation
700+
mac_invoc_tt(@path,~[token_tree]), // new macro-invocation
701701
}
702702
703703
pub type lit = spanned<lit_>;
@@ -894,7 +894,7 @@ pub enum ty_ {
894894
ty_closure(@TyClosure),
895895
ty_bare_fn(@TyBareFn),
896896
ty_tup(~[@Ty]),
897-
ty_path(@Path, node_id),
897+
ty_path(@path, node_id),
898898
ty_mac(mac),
899899
// ty_infer means the type should be inferred instead of it having been
900900
// specified. This should only appear at the "top level" of a type and not
@@ -1118,13 +1118,13 @@ pub enum view_path_ {
11181118
// or just
11191119
//
11201120
// foo::bar::baz (with 'baz =' implicitly on the left)
1121-
view_path_simple(ident, @Path, namespace, node_id),
1121+
view_path_simple(ident, @path, namespace, node_id),
11221122
11231123
// foo::bar::*
1124-
view_path_glob(@Path, node_id),
1124+
view_path_glob(@path, node_id),
11251125
11261126
// foo::bar::{a,b,c}
1127-
view_path_list(@Path, ~[path_list_ident], node_id)
1127+
view_path_list(@path, ~[path_list_ident], node_id)
11281128
}
11291129
11301130
#[auto_encode]
@@ -1177,7 +1177,7 @@ pub struct attribute_ {
11771177
#[auto_decode]
11781178
#[deriving(Eq)]
11791179
pub struct trait_ref {
1180-
path: @Path,
1180+
path: @path,
11811181
ref_id: node_id,
11821182
}
11831183

branches/auto/src/libsyntax/ast_util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str {
3030
}
3131

3232

33-
pub fn path_to_ident(p: @Path) -> ident { copy *p.idents.last() }
33+
pub fn path_to_ident(p: @path) -> ident { copy *p.idents.last() }
3434

3535
pub fn local_def(id: node_id) -> def_id {
3636
ast::def_id { crate: local_crate, node: id }
@@ -223,8 +223,8 @@ pub fn default_block(
223223
}
224224
}
225225

226-
pub fn ident_to_path(s: span, +i: ident) -> @Path {
227-
@ast::Path { span: s,
226+
pub fn ident_to_path(s: span, +i: ident) -> @path {
227+
@ast::path { span: s,
228228
global: false,
229229
idents: ~[i],
230230
rp: None,

0 commit comments

Comments
 (0)