Skip to content

Commit 326e6ba

Browse files
author
blake2-ppc
committed
---
yaml --- r: 80761 b: refs/heads/try c: 92c4c07 h: refs/heads/master i: 80759: 4a6288a v: v3
1 parent e2aef59 commit 326e6ba

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: a241deb97931b7c993e88c600d2b35912730a7e8
5+
refs/heads/try: 92c4c077a0be758246475ffcacafee0060885b9f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/intrinsic.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
402402
Ret(bcx, morestack_addr);
403403
}
404404
"offset" => {
405+
let ptr = get_param(decl, first_real_arg);
406+
let offset = get_param(decl, first_real_arg + 1);
407+
Ret(bcx, GEP(bcx, ptr, [offset]));
408+
}
409+
"offset_inbounds" => {
405410
let ptr = get_param(decl, first_real_arg);
406411
let offset = get_param(decl, first_real_arg + 1);
407412
Ret(bcx, InBoundsGEP(bcx, ptr, [offset]));

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ use parse::{new_sub_parser_from_file, ParseSess};
8080
use opt_vec;
8181
use opt_vec::OptVec;
8282

83-
use std::either::Either;
84-
use std::either;
8583
use std::hashmap::HashSet;
8684
use std::util;
8785
use std::vec;
@@ -94,7 +92,6 @@ enum restriction {
9492
RESTRICT_NO_BAR_OR_DOUBLEBAR_OP,
9593
}
9694

97-
type arg_or_capture_item = Either<arg, ()>;
9895
type item_info = (Ident, item_, Option<~[Attribute]>);
9996

10097
/// How to parse a path. There are four different kinds of paths, all of which
@@ -936,7 +933,7 @@ impl Parser {
936933
let (explicit_self, d) = do self.parse_fn_decl_with_self() |p| {
937934
// This is somewhat dubious; We don't want to allow argument
938935
// names to be left off if there is a definition...
939-
either::Left(p.parse_arg_general(false))
936+
p.parse_arg_general(false)
940937
};
941938

942939
let hi = p.last_span.hi;
@@ -1290,12 +1287,12 @@ impl Parser {
12901287
}
12911288

12921289
// parse a single function argument
1293-
pub fn parse_arg(&self) -> arg_or_capture_item {
1294-
either::Left(self.parse_arg_general(true))
1290+
pub fn parse_arg(&self) -> arg {
1291+
self.parse_arg_general(true)
12951292
}
12961293

12971294
// parse an argument in a lambda header e.g. |arg, arg|
1298-
pub fn parse_fn_block_arg(&self) -> arg_or_capture_item {
1295+
pub fn parse_fn_block_arg(&self) -> arg {
12991296
self.parse_arg_mode();
13001297
let is_mutbl = self.eat_keyword(keywords::Mut);
13011298
let pat = self.parse_pat();
@@ -1308,12 +1305,12 @@ impl Parser {
13081305
span: mk_sp(self.span.lo, self.span.hi),
13091306
}
13101307
};
1311-
either::Left(ast::arg {
1308+
ast::arg {
13121309
is_mutbl: is_mutbl,
13131310
ty: t,
13141311
pat: pat,
13151312
id: ast::DUMMY_NODE_ID
1316-
})
1313+
}
13171314
}
13181315

13191316
pub fn maybe_parse_fixed_vstore(&self) -> Option<@ast::Expr> {
@@ -3500,19 +3497,17 @@ impl Parser {
35003497

35013498
// parse the argument list and result type of a function declaration
35023499
pub fn parse_fn_decl(&self) -> fn_decl {
3503-
let args_or_capture_items: ~[arg_or_capture_item] =
3500+
let args: ~[arg] =
35043501
self.parse_unspanned_seq(
35053502
&token::LPAREN,
35063503
&token::RPAREN,
35073504
seq_sep_trailing_disallowed(token::COMMA),
35083505
|p| p.parse_arg()
35093506
);
35103507

3511-
let inputs = either::lefts(args_or_capture_items.move_iter()).collect();
3512-
35133508
let (ret_style, ret_ty) = self.parse_ret_ty();
35143509
ast::fn_decl {
3515-
inputs: inputs,
3510+
inputs: args,
35163511
output: ret_ty,
35173512
cf: ret_style,
35183513
}
@@ -3542,7 +3537,7 @@ impl Parser {
35423537
fn parse_fn_decl_with_self(
35433538
&self,
35443539
parse_arg_fn:
3545-
&fn(&Parser) -> arg_or_capture_item
3540+
&fn(&Parser) -> arg
35463541
) -> (explicit_self, fn_decl) {
35473542
fn maybe_parse_explicit_self(
35483543
cnstr: &fn(v: Mutability) -> ast::explicit_self_,
@@ -3650,20 +3645,20 @@ impl Parser {
36503645
};
36513646

36523647
// If we parsed a self type, expect a comma before the argument list.
3653-
let args_or_capture_items;
3648+
let fn_inputs;
36543649
if explicit_self != sty_static {
36553650
match *self.token {
36563651
token::COMMA => {
36573652
self.bump();
36583653
let sep = seq_sep_trailing_disallowed(token::COMMA);
3659-
args_or_capture_items = self.parse_seq_to_before_end(
3654+
fn_inputs = self.parse_seq_to_before_end(
36603655
&token::RPAREN,
36613656
sep,
36623657
parse_arg_fn
36633658
);
36643659
}
36653660
token::RPAREN => {
3666-
args_or_capture_items = ~[];
3661+
fn_inputs = ~[];
36673662
}
36683663
_ => {
36693664
self.fatal(
@@ -3676,7 +3671,7 @@ impl Parser {
36763671
}
36773672
} else {
36783673
let sep = seq_sep_trailing_disallowed(token::COMMA);
3679-
args_or_capture_items = self.parse_seq_to_before_end(
3674+
fn_inputs = self.parse_seq_to_before_end(
36803675
&token::RPAREN,
36813676
sep,
36823677
parse_arg_fn
@@ -3687,11 +3682,10 @@ impl Parser {
36873682

36883683
let hi = self.span.hi;
36893684

3690-
let inputs = either::lefts(args_or_capture_items.move_iter()).collect();
36913685
let (ret_style, ret_ty) = self.parse_ret_ty();
36923686

36933687
let fn_decl = ast::fn_decl {
3694-
inputs: inputs,
3688+
inputs: fn_inputs,
36953689
output: ret_ty,
36963690
cf: ret_style
36973691
};
@@ -3720,7 +3714,7 @@ impl Parser {
37203714
};
37213715

37223716
ast::fn_decl {
3723-
inputs: either::lefts(inputs_captures.move_iter()).collect(),
3717+
inputs: inputs_captures,
37243718
output: output,
37253719
cf: return_val,
37263720
}

0 commit comments

Comments
 (0)