Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
4e263cd9
Commit
4e263cd9
authored
Mar 05, 2003
by
Andreas Jaeger
Committed by
Andreas Jaeger
Mar 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* treetree.c (init_c_lex): Follow change to c-common.h.
From-SVN: r63828
parent
dc2b3526
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
127 deletions
+131
-127
gcc/treelang/ChangeLog
+9
-5
gcc/treelang/treetree.c
+122
-122
No files found.
gcc/treelang/ChangeLog
View file @
4e263cd9
2003-03-05 Andreas Jaeger <aj@suse.de>
* treetree.c (init_c_lex): Follow change to c-common.h.
2003-03-04 Tom Tromey <tromey@redhat.com>
2003-03-04 Tom Tromey <tromey@redhat.com>
* Make-lang.in (treelang.tags): New target.
* Make-lang.in (treelang.tags): New target.
...
@@ -5,12 +9,12 @@
...
@@ -5,12 +9,12 @@
2003-03-01 Tim Josling <tej@melbpc.org.au>
2003-03-01 Tim Josling <tej@melbpc.org.au>
Name clashes with rtl.h fixed.
Name clashes with rtl.h fixed.
* lex.l: Tokens PLUS, MINUS, RETURN changed to tl_PLUS tl_MINUS
* lex.l: Tokens PLUS, MINUS, RETURN changed to tl_PLUS tl_MINUS
tl_RETURN.
tl_RETURN.
* parse.y: Ditto.
* parse.y: Ditto.
2003-02-24 Tim Josling <tej@melbpc.org.au>
2003-02-24 Tim Josling <tej@melbpc.org.au>
* parse.y (my_yylex): New - ensure lexer time is charged to
* parse.y (my_yylex): New - ensure lexer time is charged to
...
@@ -18,11 +22,11 @@
...
@@ -18,11 +22,11 @@
(yylex): redefine as invocation of my_yylex which then calls
(yylex): redefine as invocation of my_yylex which then calls
flex-generated yylex.
flex-generated yylex.
(timevar.h): include.
(timevar.h): include.
2003-02-23 Tim Josling <tej@melbpc.org.au>
2003-02-23 Tim Josling <tej@melbpc.org.au>
Fix garbage collection, add more error checking, force GC always.
Fix garbage collection, add more error checking, force GC always.
* Make-lang.in (treelang/tree1.o): Depend on treelang/treetree.h
* Make-lang.in (treelang/tree1.o): Depend on treelang/treetree.h
(treelang/treetree.o): Depend on treelang/parse.h
(treelang/treetree.o): Depend on treelang/parse.h
...
...
gcc/treelang/treetree.c
View file @
4e263cd9
/*
/*
TREELANG Compiler back end interface (treetree.c)
TREELANG Compiler back end interface (treetree.c)
Called by the parser.
Called by the parser.
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, Free Software Foundation, Inc.
This code is based on toy.c written by Richard Kenner.
This code is based on toy.c written by Richard Kenner.
It was later modified by Jonathan Bartlett whose changes have all
It was later modified by Jonathan Bartlett whose changes have all
been removed (by Tim Josling).
been removed (by Tim Josling).
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
In other words, you are welcome to use, share and improve this program.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding!
what you give them. Help stamp out software-hoarding!
---------------------------------------------------------------------------
---------------------------------------------------------------------------
...
@@ -110,9 +110,9 @@ extern char **file_names;
...
@@ -110,9 +110,9 @@ extern char **file_names;
#define LANG_HOOKS_INIT treelang_init
#define LANG_HOOKS_INIT treelang_init
#undef LANG_HOOKS_NAME
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU treelang"
#define LANG_HOOKS_NAME "GNU treelang"
#undef LANG_HOOKS_FINISH
#undef LANG_HOOKS_FINISH
#define LANG_HOOKS_FINISH treelang_finish
#define LANG_HOOKS_FINISH treelang_finish
#undef LANG_HOOKS_DECODE_OPTION
#undef LANG_HOOKS_DECODE_OPTION
#define LANG_HOOKS_DECODE_OPTION treelang_decode_option
#define LANG_HOOKS_DECODE_OPTION treelang_decode_option
const
struct
lang_hooks
lang_hooks
=
LANG_HOOKS_INITIALIZER
;
const
struct
lang_hooks
lang_hooks
=
LANG_HOOKS_INITIALIZER
;
...
@@ -149,14 +149,14 @@ unsigned int tree_code_char_size = 0;
...
@@ -149,14 +149,14 @@ unsigned int tree_code_char_size = 0;
/* Return the tree stuff for this type TYPE_NUM. */
/* Return the tree stuff for this type TYPE_NUM. */
tree
tree
tree_code_get_type
(
int
type_num
)
tree_code_get_type
(
int
type_num
)
{
{
switch
(
type_num
)
switch
(
type_num
)
{
{
case
SIGNED_CHAR
:
case
SIGNED_CHAR
:
return
signed_char_type_node
;
return
signed_char_type_node
;
case
UNSIGNED_CHAR
:
case
UNSIGNED_CHAR
:
return
unsigned_char_type_node
;
return
unsigned_char_type_node
;
...
@@ -164,10 +164,10 @@ tree_code_get_type (int type_num)
...
@@ -164,10 +164,10 @@ tree_code_get_type (int type_num)
return
integer_type_node
;
return
integer_type_node
;
case
UNSIGNED_INT
:
case
UNSIGNED_INT
:
return
unsigned_type_node
;
return
unsigned_type_node
;
case
VOID_TYPE
:
case
VOID_TYPE
:
return
void_type_node
;
return
void_type_node
;
default:
default:
abort
();
abort
();
...
@@ -182,9 +182,9 @@ void
...
@@ -182,9 +182,9 @@ void
tree_code_if_start
(
tree
exp
,
unsigned
char
*
filename
,
int
lineno
)
tree_code_if_start
(
tree
exp
,
unsigned
char
*
filename
,
int
lineno
)
{
{
tree
cond_exp
;
tree
cond_exp
;
cond_exp
=
build
(
NE_EXPR
,
cond_exp
=
build
(
NE_EXPR
,
TREE_TYPE
(
exp
),
TREE_TYPE
(
exp
),
exp
,
exp
,
build1
(
CONVERT_EXPR
,
TREE_TYPE
(
exp
),
integer_zero_node
));
build1
(
CONVERT_EXPR
,
TREE_TYPE
(
exp
),
integer_zero_node
));
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
expand_start_cond
(
cond_exp
,
/* Exit-able if nonzero. */
0
);
expand_start_cond
(
cond_exp
,
/* Exit-able if nonzero. */
0
);
...
@@ -193,7 +193,7 @@ tree_code_if_start (tree exp, unsigned char* filename, int lineno)
...
@@ -193,7 +193,7 @@ tree_code_if_start (tree exp, unsigned char* filename, int lineno)
/* Output the code for the else of an if statement. The else occurred
/* Output the code for the else of an if statement. The else occurred
at line LINENO in file FILENAME. */
at line LINENO in file FILENAME. */
void
void
tree_code_if_else
(
unsigned
char
*
filename
,
int
lineno
)
tree_code_if_else
(
unsigned
char
*
filename
,
int
lineno
)
{
{
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
...
@@ -203,7 +203,7 @@ tree_code_if_else (unsigned char* filename, int lineno)
...
@@ -203,7 +203,7 @@ tree_code_if_else (unsigned char* filename, int lineno)
/* Output the code for the end_if an if statement. The end_if (final brace) occurred
/* Output the code for the end_if an if statement. The end_if (final brace) occurred
at line LINENO in file FILENAME. */
at line LINENO in file FILENAME. */
void
void
tree_code_if_end
(
unsigned
char
*
filename
,
int
lineno
)
tree_code_if_end
(
unsigned
char
*
filename
,
int
lineno
)
{
{
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
...
@@ -214,7 +214,7 @@ tree_code_if_end (unsigned char* filename, int lineno)
...
@@ -214,7 +214,7 @@ tree_code_if_end (unsigned char* filename, int lineno)
STORAGE_CLASS, type of return variable is RET_TYPE, parameter lists
STORAGE_CLASS, type of return variable is RET_TYPE, parameter lists
is PARMS, returns decl for this function. */
is PARMS, returns decl for this function. */
tree
tree
tree_code_create_function_prototype
(
unsigned
char
*
chars
,
tree_code_create_function_prototype
(
unsigned
char
*
chars
,
unsigned
int
storage_class
,
unsigned
int
storage_class
,
unsigned
int
ret_type
,
unsigned
int
ret_type
,
...
@@ -264,24 +264,24 @@ tree_code_create_function_prototype (unsigned char* chars,
...
@@ -264,24 +264,24 @@ tree_code_create_function_prototype (unsigned char* chars,
/* Real name (optional). */
/* Real name (optional). */
SET_DECL_ASSEMBLER_NAME
(
fn_decl
,
DECL_NAME
(
fn_decl
));
SET_DECL_ASSEMBLER_NAME
(
fn_decl
,
DECL_NAME
(
fn_decl
));
TREE_PUBLIC
(
fn_decl
)
=
0
;
TREE_PUBLIC
(
fn_decl
)
=
0
;
DECL_EXTERNAL
(
fn_decl
)
=
0
;
DECL_EXTERNAL
(
fn_decl
)
=
0
;
TREE_STATIC
(
fn_decl
)
=
0
;
TREE_STATIC
(
fn_decl
)
=
0
;
switch
(
storage_class
)
switch
(
storage_class
)
{
{
case
STATIC_STORAGE
:
case
STATIC_STORAGE
:
TREE_PUBLIC
(
fn_decl
)
=
0
;
TREE_PUBLIC
(
fn_decl
)
=
0
;
break
;
break
;
case
EXTERNAL_DEFINITION_STORAGE
:
case
EXTERNAL_DEFINITION_STORAGE
:
TREE_PUBLIC
(
fn_decl
)
=
1
;
TREE_PUBLIC
(
fn_decl
)
=
1
;
TREE_STATIC
(
fn_decl
)
=
0
;
TREE_STATIC
(
fn_decl
)
=
0
;
DECL_EXTERNAL
(
fn_decl
)
=
0
;
DECL_EXTERNAL
(
fn_decl
)
=
0
;
break
;
break
;
case
EXTERNAL_REFERENCE_STORAGE
:
case
EXTERNAL_REFERENCE_STORAGE
:
TREE_PUBLIC
(
fn_decl
)
=
0
;
TREE_PUBLIC
(
fn_decl
)
=
0
;
DECL_EXTERNAL
(
fn_decl
)
=
1
;
DECL_EXTERNAL
(
fn_decl
)
=
1
;
break
;
break
;
...
@@ -302,8 +302,8 @@ tree_code_create_function_prototype (unsigned char* chars,
...
@@ -302,8 +302,8 @@ tree_code_create_function_prototype (unsigned char* chars,
PREV_SAVED (as created by tree_code_create_function_prototype),
PREV_SAVED (as created by tree_code_create_function_prototype),
the function is at line number LINENO in file FILENAME. The
the function is at line number LINENO in file FILENAME. The
parameter details are in the lists PARMS. Returns nothing. */
parameter details are in the lists PARMS. Returns nothing. */
void
void
tree_code_create_function_initial
(
tree
prev_saved
,
tree_code_create_function_initial
(
tree
prev_saved
,
unsigned
char
*
filename
,
unsigned
char
*
filename
,
int
lineno
,
int
lineno
,
struct
prod_token_parm_item
*
parms
)
struct
prod_token_parm_item
*
parms
)
...
@@ -315,7 +315,7 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -315,7 +315,7 @@ tree_code_create_function_initial (tree prev_saved,
tree
parm_decl
;
tree
parm_decl
;
tree
parm_list
;
tree
parm_list
;
tree
resultdecl
;
tree
resultdecl
;
struct
prod_token_parm_item
*
this_parm
;
struct
prod_token_parm_item
*
this_parm
;
struct
prod_token_parm_item
*
parm
;
struct
prod_token_parm_item
*
parm
;
fn_decl
=
prev_saved
;
fn_decl
=
prev_saved
;
...
@@ -336,7 +336,7 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -336,7 +336,7 @@ tree_code_create_function_initial (tree prev_saved,
DECL_SOURCE_LINE
(
fn_decl
)
=
lineno
;
DECL_SOURCE_LINE
(
fn_decl
)
=
lineno
;
/* Prepare creation of rtl for a new function. */
/* Prepare creation of rtl for a new function. */
resultdecl
=
DECL_RESULT
(
fn_decl
)
=
build_decl
(
RESULT_DECL
,
NULL_TREE
,
TREE_TYPE
(
TREE_TYPE
(
fn_decl
)));
resultdecl
=
DECL_RESULT
(
fn_decl
)
=
build_decl
(
RESULT_DECL
,
NULL_TREE
,
TREE_TYPE
(
TREE_TYPE
(
fn_decl
)));
DECL_CONTEXT
(
DECL_RESULT
(
fn_decl
))
=
fn_decl
;
DECL_CONTEXT
(
DECL_RESULT
(
fn_decl
))
=
fn_decl
;
DECL_SOURCE_FILE
(
resultdecl
)
=
(
const
char
*
)
filename
;
DECL_SOURCE_FILE
(
resultdecl
)
=
(
const
char
*
)
filename
;
...
@@ -348,10 +348,10 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -348,10 +348,10 @@ tree_code_create_function_initial (tree prev_saved,
parm_list
=
NULL_TREE
;
parm_list
=
NULL_TREE
;
for
(
parm
=
parms
;
parm
;
parm
=
parm
->
tp
.
par
.
next
)
for
(
parm
=
parms
;
parm
;
parm
=
parm
->
tp
.
par
.
next
)
{
{
parm_decl
=
build_decl
(
PARM_DECL
,
get_identifier
parm_decl
=
build_decl
(
PARM_DECL
,
get_identifier
((
const
char
*
)
(
parm
->
tp
.
par
.
variable_name
)),
((
const
char
*
)
(
parm
->
tp
.
par
.
variable_name
)),
get_type_for_numeric_type
(
parm
->
type
));
get_type_for_numeric_type
(
parm
->
type
));
/* Some languages have different nominal and real types. */
/* Some languages have different nominal and real types. */
DECL_ARG_TYPE
(
parm_decl
)
=
TREE_TYPE
(
parm_decl
);
DECL_ARG_TYPE
(
parm_decl
)
=
TREE_TYPE
(
parm_decl
);
if
(
!
DECL_ARG_TYPE
(
parm_decl
))
if
(
!
DECL_ARG_TYPE
(
parm_decl
))
...
@@ -366,7 +366,7 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -366,7 +366,7 @@ tree_code_create_function_initial (tree prev_saved,
/* Back into reverse order as the back end likes them. */
/* Back into reverse order as the back end likes them. */
parm_list
=
nreverse
(
parm_list
);
parm_list
=
nreverse
(
parm_list
);
DECL_ARGUMENTS
(
fn_decl
)
=
parm_list
;
DECL_ARGUMENTS
(
fn_decl
)
=
parm_list
;
/* Save the decls for use when the args are referred to. */
/* Save the decls for use when the args are referred to. */
...
@@ -389,23 +389,23 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -389,23 +389,23 @@ tree_code_create_function_initial (tree prev_saved,
make_decl_rtl
(
fn_decl
,
NULL
);
make_decl_rtl
(
fn_decl
,
NULL
);
/* Use filename/lineno from above. */
/* Use filename/lineno from above. */
init_function_start
(
fn_decl
,
(
const
char
*
)
filename
,
lineno
);
init_function_start
(
fn_decl
,
(
const
char
*
)
filename
,
lineno
);
/* Create rtl for startup code of function, such as saving registers. */
/* Create rtl for startup code of function, such as saving registers. */
expand_function_start
(
fn_decl
,
0
);
expand_function_start
(
fn_decl
,
0
);
/* Function.c requires a push at the start of the function. that
/* Function.c requires a push at the start of the function. that
looks like a bug to me but let's make it happy. */
looks like a bug to me but let's make it happy. */
(
*
lang_hooks
.
decls
.
pushlevel
)
(
0
);
(
*
lang_hooks
.
decls
.
pushlevel
)
(
0
);
/* Create rtl for the start of a new scope. */
/* Create rtl for the start of a new scope. */
expand_start_bindings
(
2
);
expand_start_bindings
(
2
);
/* Put the parameters into the symbol table. */
/* Put the parameters into the symbol table. */
for
(
first_param
=
param_decl
=
nreverse
(
DECL_ARGUMENTS
(
fn_decl
));
for
(
first_param
=
param_decl
=
nreverse
(
DECL_ARGUMENTS
(
fn_decl
));
param_decl
;
param_decl
;
param_decl
=
next_param
)
param_decl
=
next_param
)
...
@@ -423,23 +423,23 @@ tree_code_create_function_initial (tree prev_saved,
...
@@ -423,23 +423,23 @@ tree_code_create_function_initial (tree prev_saved,
/* Force it to be output, else may be solely inlined. */
/* Force it to be output, else may be solely inlined. */
TREE_ADDRESSABLE
(
fn_decl
)
=
1
;
TREE_ADDRESSABLE
(
fn_decl
)
=
1
;
/* Stop -O3 from deleting it. */
/* Stop -O3 from deleting it. */
TREE_USED
(
fn_decl
)
=
1
;
TREE_USED
(
fn_decl
)
=
1
;
/* Add a new level to the debugger symbol table. */
/* Add a new level to the debugger symbol table. */
(
*
lang_hooks
.
decls
.
pushlevel
)
(
0
);
(
*
lang_hooks
.
decls
.
pushlevel
)
(
0
);
/* Create rtl for the start of a new scope. */
/* Create rtl for the start of a new scope. */
expand_start_bindings
(
0
);
expand_start_bindings
(
0
);
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
}
}
/* Wrapup a function contained in file FILENAME, ending at line LINENO. */
/* Wrapup a function contained in file FILENAME, ending at line LINENO. */
void
void
tree_code_create_function_wrapup
(
unsigned
char
*
filename
,
tree_code_create_function_wrapup
(
unsigned
char
*
filename
,
int
lineno
)
int
lineno
)
{
{
...
@@ -447,52 +447,52 @@ tree_code_create_function_wrapup (unsigned char* filename,
...
@@ -447,52 +447,52 @@ tree_code_create_function_wrapup (unsigned char* filename,
tree
fn_decl
;
tree
fn_decl
;
fn_decl
=
current_function_decl
;
fn_decl
=
current_function_decl
;
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
/* Output the line number information. */
/* Get completely built level from debugger symbol table. */
/* Get completely built level from debugger symbol table. */
block
=
(
*
lang_hooks
.
decls
.
poplevel
)
(
1
,
0
,
0
);
block
=
(
*
lang_hooks
.
decls
.
poplevel
)
(
1
,
0
,
0
);
/* Emit rtl for end of scope. */
/* Emit rtl for end of scope. */
expand_end_bindings
(
block
,
0
,
1
);
expand_end_bindings
(
block
,
0
,
1
);
/* Emit rtl for end of function. */
/* Emit rtl for end of function. */
expand_function_end
((
const
char
*
)
filename
,
lineno
,
0
);
expand_function_end
((
const
char
*
)
filename
,
lineno
,
0
);
/* Pop the level. */
/* Pop the level. */
block
=
(
*
lang_hooks
.
decls
.
poplevel
)
(
1
,
0
,
1
);
block
=
(
*
lang_hooks
.
decls
.
poplevel
)
(
1
,
0
,
1
);
/* And attach it to the function. */
/* And attach it to the function. */
DECL_INITIAL
(
fn_decl
)
=
block
;
DECL_INITIAL
(
fn_decl
)
=
block
;
/* Emit rtl for end of scope. */
/* Emit rtl for end of scope. */
expand_end_bindings
(
block
,
0
,
1
);
expand_end_bindings
(
block
,
0
,
1
);
/* Call optimization and convert optimized rtl to assembly code. */
/* Call optimization and convert optimized rtl to assembly code. */
rest_of_compilation
(
fn_decl
);
rest_of_compilation
(
fn_decl
);
/* We are not inside of any scope now. */
/* We are not inside of any scope now. */
current_function_decl
=
NULL_TREE
;
current_function_decl
=
NULL_TREE
;
}
}
/*
/*
Create a variable.
Create a variable.
The storage class is STORAGE_CLASS (eg LOCAL).
The storage class is STORAGE_CLASS (eg LOCAL).
The name is CHARS/LENGTH.
The name is CHARS/LENGTH.
The type is EXPRESSION_TYPE (eg UNSIGNED_TYPE).
The type is EXPRESSION_TYPE (eg UNSIGNED_TYPE).
The init tree is INIT.
The init tree is INIT.
*/
*/
tree
tree
tree_code_create_variable
(
unsigned
int
storage_class
,
tree_code_create_variable
(
unsigned
int
storage_class
,
unsigned
char
*
chars
,
unsigned
char
*
chars
,
unsigned
int
length
,
unsigned
int
length
,
...
@@ -522,10 +522,10 @@ tree_code_create_variable (unsigned int storage_class,
...
@@ -522,10 +522,10 @@ tree_code_create_variable (unsigned int storage_class,
DECL_INITIAL
(
var_decl
)
=
build1
(
CONVERT_EXPR
,
var_type
,
init
);
DECL_INITIAL
(
var_decl
)
=
build1
(
CONVERT_EXPR
,
var_type
,
init
);
else
else
DECL_INITIAL
(
var_decl
)
=
NULL_TREE
;
DECL_INITIAL
(
var_decl
)
=
NULL_TREE
;
/* 4. Compute size etc. */
/* 4. Compute size etc. */
layout_decl
(
var_decl
,
0
);
layout_decl
(
var_decl
,
0
);
if
(
TYPE_SIZE
(
var_type
)
==
0
)
if
(
TYPE_SIZE
(
var_type
)
==
0
)
abort
();
/* Did not calculate size. */
abort
();
/* Did not calculate size. */
...
@@ -546,27 +546,27 @@ tree_code_create_variable (unsigned int storage_class,
...
@@ -546,27 +546,27 @@ tree_code_create_variable (unsigned int storage_class,
TREE_STATIC
(
var_decl
)
=
0
;
TREE_STATIC
(
var_decl
)
=
0
;
TREE_PUBLIC
(
var_decl
)
=
0
;
TREE_PUBLIC
(
var_decl
)
=
0
;
break
;
break
;
case
EXTERNAL_DEFINITION_STORAGE
:
case
EXTERNAL_DEFINITION_STORAGE
:
TREE_STATIC
(
var_decl
)
=
0
;
TREE_STATIC
(
var_decl
)
=
0
;
TREE_PUBLIC
(
var_decl
)
=
1
;
TREE_PUBLIC
(
var_decl
)
=
1
;
break
;
break
;
case
EXTERNAL_REFERENCE_STORAGE
:
case
EXTERNAL_REFERENCE_STORAGE
:
DECL_EXTERNAL
(
var_decl
)
=
1
;
DECL_EXTERNAL
(
var_decl
)
=
1
;
TREE_PUBLIC
(
var_decl
)
=
0
;
TREE_PUBLIC
(
var_decl
)
=
0
;
break
;
break
;
default:
default:
abort
();
abort
();
}
}
/* This should really only be set if the variable is used. */
/* This should really only be set if the variable is used. */
TREE_USED
(
var_decl
)
=
1
;
TREE_USED
(
var_decl
)
=
1
;
/* Expand declaration and initial value if any. */
/* Expand declaration and initial value if any. */
if
(
TREE_STATIC
(
var_decl
))
if
(
TREE_STATIC
(
var_decl
))
rest_of_decl_compilation
(
var_decl
,
0
,
0
,
0
);
rest_of_decl_compilation
(
var_decl
,
0
,
0
,
0
);
else
else
{
{
...
@@ -574,9 +574,9 @@ tree_code_create_variable (unsigned int storage_class,
...
@@ -574,9 +574,9 @@ tree_code_create_variable (unsigned int storage_class,
if
(
DECL_INITIAL
(
var_decl
))
if
(
DECL_INITIAL
(
var_decl
))
expand_decl_init
(
var_decl
);
expand_decl_init
(
var_decl
);
}
}
return
pushdecl
(
copy_node
(
var_decl
));
return
pushdecl
(
copy_node
(
var_decl
));
}
}
...
@@ -599,7 +599,7 @@ tree_code_generate_return (tree type, tree exp)
...
@@ -599,7 +599,7 @@ tree_code_generate_return (tree type, tree exp)
if
(
exp
)
if
(
exp
)
{
{
setret
=
build
(
MODIFY_EXPR
,
type
,
DECL_RESULT
(
current_function_decl
),
setret
=
build
(
MODIFY_EXPR
,
type
,
DECL_RESULT
(
current_function_decl
),
build1
(
CONVERT_EXPR
,
type
,
exp
));
build1
(
CONVERT_EXPR
,
type
,
exp
));
TREE_SIDE_EFFECTS
(
setret
)
=
1
;
TREE_SIDE_EFFECTS
(
setret
)
=
1
;
TREE_USED
(
setret
)
=
1
;
TREE_USED
(
setret
)
=
1
;
...
@@ -611,12 +611,12 @@ tree_code_generate_return (tree type, tree exp)
...
@@ -611,12 +611,12 @@ tree_code_generate_return (tree type, tree exp)
/* Output the code for this expression statement CODE. */
/* Output the code for this expression statement CODE. */
void
void
tree_code_output_expression_statement
(
tree
code
,
tree_code_output_expression_statement
(
tree
code
,
unsigned
char
*
filename
,
int
lineno
)
unsigned
char
*
filename
,
int
lineno
)
{
{
/* Output the line number information. */
/* Output the line number information. */
emit_line_note
((
const
char
*
)
filename
,
lineno
);
emit_line_note
((
const
char
*
)
filename
,
lineno
);
TREE_USED
(
code
)
=
1
;
TREE_USED
(
code
)
=
1
;
TREE_SIDE_EFFECTS
(
code
)
=
1
;
TREE_SIDE_EFFECTS
(
code
)
=
1
;
expand_expr_stmt
(
code
);
expand_expr_stmt
(
code
);
...
@@ -625,7 +625,7 @@ tree_code_output_expression_statement (tree code,
...
@@ -625,7 +625,7 @@ tree_code_output_expression_statement (tree code,
/* Return a tree for a constant integer value in the token TOK. No
/* Return a tree for a constant integer value in the token TOK. No
size checking is done. */
size checking is done. */
tree
tree
tree_code_get_integer_value
(
unsigned
char
*
chars
,
unsigned
int
length
)
tree_code_get_integer_value
(
unsigned
char
*
chars
,
unsigned
int
length
)
{
{
long
long
int
val
=
0
;
long
long
int
val
=
0
;
...
@@ -654,8 +654,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
...
@@ -654,8 +654,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
/* Return the tree for an expresssion, type EXP_TYPE (see treetree.h)
/* Return the tree for an expresssion, type EXP_TYPE (see treetree.h)
with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe). */
with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe). */
tree
tree
tree_code_get_expression
(
unsigned
int
exp_type
,
tree_code_get_expression
(
unsigned
int
exp_type
,
tree
type
,
tree
op1
,
tree
op2
,
tree
op3
ATTRIBUTE_UNUSED
)
tree
type
,
tree
op1
,
tree
op2
,
tree
op3
ATTRIBUTE_UNUSED
)
{
{
tree
ret1
;
tree
ret1
;
...
@@ -667,8 +667,8 @@ tree_code_get_expression (unsigned int exp_type,
...
@@ -667,8 +667,8 @@ tree_code_get_expression (unsigned int exp_type,
if
(
!
op1
||
!
op2
)
if
(
!
op1
||
!
op2
)
abort
();
abort
();
operator
=
MODIFY_EXPR
;
operator
=
MODIFY_EXPR
;
ret1
=
build
(
operator
,
type
,
ret1
=
build
(
operator
,
type
,
op1
,
op1
,
build1
(
CONVERT_EXPR
,
type
,
op2
));
build1
(
CONVERT_EXPR
,
type
,
op2
));
break
;
break
;
...
@@ -676,21 +676,21 @@ tree_code_get_expression (unsigned int exp_type,
...
@@ -676,21 +676,21 @@ tree_code_get_expression (unsigned int exp_type,
case
EXP_PLUS
:
case
EXP_PLUS
:
operator
=
PLUS_EXPR
;
operator
=
PLUS_EXPR
;
goto
binary_expression
;
goto
binary_expression
;
case
EXP_MINUS
:
case
EXP_MINUS
:
operator
=
MINUS_EXPR
;
operator
=
MINUS_EXPR
;
goto
binary_expression
;
goto
binary_expression
;
case
EXP_EQUALS
:
case
EXP_EQUALS
:
operator
=
EQ_EXPR
;
operator
=
EQ_EXPR
;
goto
binary_expression
;
goto
binary_expression
;
/* Expand a binary expression. Ensure the operands are the right type. */
/* Expand a binary expression. Ensure the operands are the right type. */
binary_expression:
binary_expression:
if
(
!
op1
||
!
op2
)
if
(
!
op1
||
!
op2
)
abort
();
abort
();
ret1
=
build
(
operator
,
type
,
ret1
=
build
(
operator
,
type
,
build1
(
CONVERT_EXPR
,
type
,
op1
),
build1
(
CONVERT_EXPR
,
type
,
op1
),
build1
(
CONVERT_EXPR
,
type
,
op2
));
build1
(
CONVERT_EXPR
,
type
,
op2
));
break
;
break
;
...
@@ -705,7 +705,7 @@ tree_code_get_expression (unsigned int exp_type,
...
@@ -705,7 +705,7 @@ tree_code_get_expression (unsigned int exp_type,
else
else
ret1
=
build1
(
CONVERT_EXPR
,
type
,
op1
);
ret1
=
build1
(
CONVERT_EXPR
,
type
,
op1
);
break
;
break
;
case
EXP_FUNCTION_INVOCATION
:
case
EXP_FUNCTION_INVOCATION
:
if
(
!
op1
||
!
op2
)
if
(
!
op1
||
!
op2
)
abort
();
abort
();
...
@@ -719,13 +719,13 @@ tree_code_get_expression (unsigned int exp_type,
...
@@ -719,13 +719,13 @@ tree_code_get_expression (unsigned int exp_type,
default:
default:
abort
();
abort
();
}
}
return
ret1
;
return
ret1
;
}
}
/* Init parameter list and return empty list. */
/* Init parameter list and return empty list. */
tree
tree
tree_code_init_parameters
(
void
)
tree_code_init_parameters
(
void
)
{
{
return
NULL_TREE
;
return
NULL_TREE
;
...
@@ -734,11 +734,11 @@ tree_code_init_parameters (void)
...
@@ -734,11 +734,11 @@ tree_code_init_parameters (void)
/* Add a parameter EXP whose expression type is EXP_PROTO to list
/* Add a parameter EXP whose expression type is EXP_PROTO to list
LIST, returning the new list. */
LIST, returning the new list. */
tree
tree
tree_code_add_parameter
(
tree
list
,
tree
proto_exp
,
tree
exp
)
tree_code_add_parameter
(
tree
list
,
tree
proto_exp
,
tree
exp
)
{
{
tree
new_exp
;
tree
new_exp
;
new_exp
=
tree_cons
(
NULL_TREE
,
new_exp
=
tree_cons
(
NULL_TREE
,
build1
(
CONVERT_EXPR
,
TREE_TYPE
(
proto_exp
),
exp
),
build1
(
CONVERT_EXPR
,
TREE_TYPE
(
proto_exp
),
exp
),
NULL_TREE
);
NULL_TREE
);
if
(
!
list
)
if
(
!
list
)
...
@@ -751,45 +751,45 @@ tree_code_add_parameter (tree list, tree proto_exp, tree exp)
...
@@ -751,45 +751,45 @@ tree_code_add_parameter (tree list, tree proto_exp, tree exp)
tree
tree
get_type_for_numeric_type
(
unsigned
int
numeric_type
)
get_type_for_numeric_type
(
unsigned
int
numeric_type
)
{
{
int
size1
;
int
size1
;
int
sign1
;
int
sign1
;
switch
(
numeric_type
)
switch
(
numeric_type
)
{
{
case
VOID_TYPE
:
case
VOID_TYPE
:
return
void_type_node
;
return
void_type_node
;
case
SIGNED_INT
:
case
SIGNED_INT
:
size1
=
tree_code_int_size
;
size1
=
tree_code_int_size
;
sign1
=
1
;
sign1
=
1
;
break
;
break
;
case
UNSIGNED_INT
:
case
UNSIGNED_INT
:
size1
=
tree_code_int_size
;
size1
=
tree_code_int_size
;
sign1
=
0
;
sign1
=
0
;
break
;
break
;
case
SIGNED_CHAR
:
case
SIGNED_CHAR
:
size1
=
tree_code_char_size
;
size1
=
tree_code_char_size
;
sign1
=
1
;
sign1
=
1
;
break
;
break
;
case
UNSIGNED_CHAR
:
case
UNSIGNED_CHAR
:
size1
=
tree_code_char_size
;
size1
=
tree_code_char_size
;
sign1
=
0
;
sign1
=
0
;
break
;
break
;
default:
default:
abort
();
abort
();
}
}
return
tree_code_get_numeric_type
(
size1
,
sign1
);
return
tree_code_get_numeric_type
(
size1
,
sign1
);
}
}
/* Return tree representing a numeric type of size SIZE1 bits and
/* Return tree representing a numeric type of size SIZE1 bits and
signed if SIGN1 != 0. */
signed if SIGN1 != 0. */
tree
tree
tree_code_get_numeric_type
(
unsigned
int
size1
,
unsigned
int
sign1
)
tree_code_get_numeric_type
(
unsigned
int
size1
,
unsigned
int
sign1
)
{
{
tree
ret1
;
tree
ret1
;
...
@@ -808,10 +808,10 @@ tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
...
@@ -808,10 +808,10 @@ tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
else
else
ret1
=
unsigned_char_type_node
;
ret1
=
unsigned_char_type_node
;
}
}
else
else
abort
();
abort
();
return
ret1
;
return
ret1
;
}
}
/* Garbage Collection. */
/* Garbage Collection. */
...
@@ -826,7 +826,7 @@ tree_ggc_storage_always_used (void * m)
...
@@ -826,7 +826,7 @@ tree_ggc_storage_always_used (void * m)
if
(
*
mm
)
if
(
*
mm
)
ggc_mark
(
*
mm
);
ggc_mark
(
*
mm
);
}
}
/* Following from c-lang.c. */
/* Following from c-lang.c. */
...
@@ -857,8 +857,8 @@ check_function_format (int *status ATTRIBUTE_UNUSED,
...
@@ -857,8 +857,8 @@ check_function_format (int *status ATTRIBUTE_UNUSED,
/* Tell the c code we are not objective C. */
/* Tell the c code we are not objective C. */
int
int
objc_comptypes
(
tree
lhs
ATTRIBUTE_UNUSED
,
objc_comptypes
(
tree
lhs
ATTRIBUTE_UNUSED
,
tree
rhs
ATTRIBUTE_UNUSED
,
tree
rhs
ATTRIBUTE_UNUSED
,
int
reflexive
ATTRIBUTE_UNUSED
)
int
reflexive
ATTRIBUTE_UNUSED
)
{
{
return
0
;
return
0
;
...
@@ -932,8 +932,8 @@ cpp_create_reader (enum c_lang lang ATTRIBUTE_UNUSED)
...
@@ -932,8 +932,8 @@ cpp_create_reader (enum c_lang lang ATTRIBUTE_UNUSED)
/* Should not be called for treelang. */
/* Should not be called for treelang. */
const
char
*
void
init_c_lex
(
const
char
*
filename
ATTRIBUTE_UNUSED
)
init_c_lex
(
void
)
{
{
abort
();
abort
();
}
}
...
@@ -973,7 +973,7 @@ handle_format_attribute (tree *node ATTRIBUTE_UNUSED,
...
@@ -973,7 +973,7 @@ handle_format_attribute (tree *node ATTRIBUTE_UNUSED,
int
flags
ATTRIBUTE_UNUSED
,
int
flags
ATTRIBUTE_UNUSED
,
bool
*
no_add_attrs
ATTRIBUTE_UNUSED
)
bool
*
no_add_attrs
ATTRIBUTE_UNUSED
)
{
{
return
NULL_TREE
;
return
NULL_TREE
;
}
}
/* Should not be called for treelang. */
/* Should not be called for treelang. */
...
@@ -1000,8 +1000,8 @@ cpp_handle_option (cpp_reader *pfile ATTRIBUTE_UNUSED,
...
@@ -1000,8 +1000,8 @@ cpp_handle_option (cpp_reader *pfile ATTRIBUTE_UNUSED,
/* Should not be called for treelang. */
/* Should not be called for treelang. */
void
void
cpp_assert
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
,
cpp_assert
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
,
const
char
*
s
ATTRIBUTE_UNUSED
)
const
char
*
s
ATTRIBUTE_UNUSED
)
{
{
abort
();
abort
();
...
@@ -1113,7 +1113,7 @@ defer_fn (tree fn ATTRIBUTE_UNUSED)
...
@@ -1113,7 +1113,7 @@ defer_fn (tree fn ATTRIBUTE_UNUSED)
/* Should not be called for treelang. */
/* Should not be called for treelang. */
cpp_options
cpp_options
*
cpp_get_options
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
)
*
cpp_get_options
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
)
{
{
abort
();
abort
();
...
@@ -1121,10 +1121,10 @@ cpp_options
...
@@ -1121,10 +1121,10 @@ cpp_options
/* Should not be called for treelang. */
/* Should not be called for treelang. */
void
void
cpp_define
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
,
const
char
*
c
ATTRIBUTE_UNUSED
)
cpp_define
(
cpp_reader
*
cr
ATTRIBUTE_UNUSED
,
const
char
*
c
ATTRIBUTE_UNUSED
)
{
{
abort
();
abort
();
}
}
/* Should not be called for treelang. */
/* Should not be called for treelang. */
...
@@ -1247,7 +1247,7 @@ treelang_init_decl_processing ()
...
@@ -1247,7 +1247,7 @@ treelang_init_decl_processing ()
tree
id
;
tree
id
;
ridpointers
=
(
tree
*
)
ggc_calloc
((
int
)
RID_MAX
,
sizeof
(
tree
));
ridpointers
=
(
tree
*
)
ggc_calloc
((
int
)
RID_MAX
,
sizeof
(
tree
));
for
(
i
=
0
;
i
<
N_reswords
;
i
++
)
for
(
i
=
0
;
i
<
N_reswords
;
i
++
)
{
{
id
=
get_identifier
(
reswords
[
i
].
word
);
id
=
get_identifier
(
reswords
[
i
].
word
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment