Skip to content

Commit

Permalink
all: merge dev.cc (81884b89bd88) into default
Browse files Browse the repository at this point in the history
With this change, default now contains Go 1.5 work.
Any future bug fixes for Go 1.4 in the compilers or
the runtime will have to be made directly to the
release branch.
  • Loading branch information
rsc committed Dec 5, 2014
2 parents 41c6b84 + 829b286 commit b9c5230
Show file tree
Hide file tree
Showing 590 changed files with 60,113 additions and 74,993 deletions.
6 changes: 3 additions & 3 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ syntax:glob
.DS_Store
.git
.gitignore
*.[568ao]
*.a[568o]
*.[5689ao]
*.a[5689o]
*.so
*.pyc
._*
.nfs.*
[568a].out
[5689a].out
*~
*.orig
*.rej
Expand Down
Empty file added dev.cc
Empty file.
41 changes: 31 additions & 10 deletions include/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ struct Addr
{
char sval[8];
float64 dval;
Prog* branch; // for 5g, 6g, 8g
Prog* branch; // for 5g, 6g, 8g, 9g
} u;

LSym* sym;
LSym* gotype;
short type;
uint8 index;
int8 scale;
int8 reg; // for 5l
int8 name; // for 5l
int8 class; // for 5l
int8 reg; // for 5l, 9l; GPRs and FPRs both start at 0
int8 name; // for 5l, 9l
int8 class; // for 5l, 9l
uint8 etype; // for 5g, 6g, 8g
int32 offset2; // for 5l, 8l
struct Node* node; // for 5g, 6g, 8g
Expand All @@ -89,9 +89,14 @@ struct Prog
int32 lineno;
Prog* link;
short as;
uchar reg; // arm only
uchar scond; // arm only
uchar scond; // arm only; condition codes

// operands
Addr from;
uchar reg; // arm, power64 only (e.g., ADD from, reg, to);
// starts at 0 for both GPRs and FPRs;
// also used for ADATA width on arm, power64
Addr from3; // power64 only (e.g., RLWM/FMADD from, reg, from3, to)
Addr to;

// for 5g, 6g, 8g internal use
Expand All @@ -103,11 +108,11 @@ struct Prog
Prog* comefrom; // 6l, 8l
Prog* pcrel; // 5l
int32 spadj;
uchar mark;
uint16 mark;
uint16 optab; // 5l, 9l
uchar back; // 6l, 8l
uchar ft; /* 6l, 8l oclass cache */
uchar tt; // 6l, 8l
uint16 optab; // 5l
uchar isize; // 6l, 8l

char width; /* fake for DATA */
Expand Down Expand Up @@ -233,10 +238,12 @@ enum
enum
{
R_ADDR = 1,
R_ADDRPOWER, // relocation for loading 31-bit address using addis and addi/ld/st for Power
R_SIZE,
R_CALL, // relocation for direct PC-relative call
R_CALLARM, // relocation for ARM direct call
R_CALLIND, // marker for indirect call (no actual relocating necessary)
R_CALLPOWER, // relocation for Power direct call
R_CONST,
R_PCREL,
R_TLS,
Expand Down Expand Up @@ -529,6 +536,9 @@ void span6(Link *ctxt, LSym *s);
// asm8.c
void span8(Link *ctxt, LSym *s);

// asm9.c
void span9(Link *ctxt, LSym *s);

// data.c
vlong addaddr(Link *ctxt, LSym *s, LSym *t);
vlong addaddrplus(Link *ctxt, LSym *s, LSym *t, vlong add);
Expand Down Expand Up @@ -576,10 +586,11 @@ Prog* copyp(Link*, Prog*);
Prog* appendp(Link*, Prog*);
vlong atolwhex(char*);

// list[568].c
// list[5689].c
void listinit5(void);
void listinit6(void);
void listinit8(void);
void listinit9(void);

// obj.c
int linklinefmt(Link *ctxt, Fmt *fp);
Expand Down Expand Up @@ -611,20 +622,30 @@ char* headstr(int);
extern char* anames5[];
extern char* anames6[];
extern char* anames8[];
extern char* anames9[];

extern char* cnames5[];
extern char* cnames9[];

extern char* dnames5[];
extern char* dnames6[];
extern char* dnames8[];
extern char* dnames9[];

extern LinkArch link386;
extern LinkArch linkamd64;
extern LinkArch linkamd64p32;
extern LinkArch linkarm;
extern LinkArch linkpower64;
extern LinkArch linkpower64le;

#pragma varargck type "A" int
#pragma varargck type "E" uint
#pragma varargck type "D" Addr*
#pragma varargck type "lD" Addr*
#pragma varargck type "P" Prog*
#pragma varargck type "R" int
#pragma varargck type "^" int
#pragma varargck type "^" int // for 5l/9l, C_* classes (liblink internal)

// TODO(ality): remove this workaround.
// It's here because Pconv in liblink/list?.c references %L.
Expand Down
1 change: 1 addition & 0 deletions lib/codereview/codereview.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
defaultcc: [email protected]
contributors: http://go.googlecode.com/hg/CONTRIBUTORS
12 changes: 9 additions & 3 deletions lib/codereview/codereview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3604,11 +3604,17 @@ def GetBaseFile(self, filename):
if use_hg_shell:
base_content = RunShell(["hg", "cat", "-r", base_rev, oldrelpath], silent_ok=True)
else:
base_content = str(self.repo[base_rev][oldrelpath].data())
try:
base_content = str(self.repo[base_rev][oldrelpath].data())
except Exception:
pass
is_binary = "\0" in base_content # Mercurial's heuristic
if status != "R":
new_content = open(relpath, "rb").read()
is_binary = is_binary or "\0" in new_content
try:
new_content = open(relpath, "rb").read()
is_binary = is_binary or "\0" in new_content
except Exception:
pass
if is_binary and base_content and use_hg_shell:
# Fetch again without converting newlines
base_content = RunShell(["hg", "cat", "-r", base_rev, oldrelpath],
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/5a/a.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ struct Sym
int32 value;
ushort type;
char *name;
char* labelname;
char sym;
};
#define S ((Sym*)0)
Expand Down Expand Up @@ -136,6 +137,8 @@ void newio(void);
void newfile(char*, int);
Sym* slookup(char*);
Sym* lookup(void);
Sym* labellookup(Sym*);
void settext(LSym*);
void syminit(Sym*);
int32 yylex(void);
int getc(void);
Expand Down
26 changes: 10 additions & 16 deletions src/cmd/5a/a.y
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,11 @@ prog:
line

line:
LLAB ':'
{
if($1->value != pc)
yyerror("redeclaration of %s", $1->name);
$1->value = pc;
}
line
| LNAME ':'
LNAME ':'
{
$1 = labellookup($1);
if($1->type == LLAB && $1->value != pc)
yyerror("redeclaration of %s", $1->labelname);
$1->type = LLAB;
$1->value = pc;
}
Expand Down Expand Up @@ -218,18 +214,21 @@ inst:
*/
| LTYPEB name ',' imm
{
settext($2.sym);
$4.type = D_CONST2;
$4.offset2 = ArgsSizeUnknown;
outcode($1, Always, &$2, 0, &$4);
}
| LTYPEB name ',' con ',' imm
{
settext($2.sym);
$6.type = D_CONST2;
$6.offset2 = ArgsSizeUnknown;
outcode($1, Always, &$2, $4, &$6);
}
| LTYPEB name ',' con ',' imm '-' con
{
settext($2.sym);
$6.type = D_CONST2;
$6.offset2 = $8;
outcode($1, Always, &$2, $4, &$6);
Expand Down Expand Up @@ -373,15 +372,10 @@ rel:
}
| LNAME offset
{
$1 = labellookup($1);
$$ = nullgen;
if(pass == 2)
yyerror("undefined label: %s", $1->name);
$$.type = D_BRANCH;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
if(pass == 2 && $1->type != LLAB)
yyerror("undefined label: %s", $1->labelname);
$$.type = D_BRANCH;
$$.offset = $1->value + $2;
}
Expand Down
Loading

0 comments on commit b9c5230

Please sign in to comment.