osprey/kgccfe/gnu/java/builtins.c File Reference

#include "config.h"
#include "system.h"
#include "tree.h"
#include "ggc.h"
#include "flags.h"
#include "java-tree.h"
#include "builtin-types.def"
#include "builtins.def"

Include dependency graph for builtins.c:

Go to the source code of this file.

Data Types

union  string_or_tree
type  builtin_record

Defines

#define DEF_PRIMITIVE_TYPE(NAME, VALUE)   NAME,
#define DEF_FUNCTION_TYPE_0(NAME, RETURN)   NAME,
#define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1)   NAME,
#define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2)   NAME,
#define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3)   NAME,
#define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4)   NAME,
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN)   NAME,
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1)   NAME,
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2)   NAME,
#define DEF_POINTER_TYPE(NAME, TYPE)   NAME,
#define intmax_type_node   NULL_TREE
#define traditional_ptr_type_node   NULL_TREE
#define traditional_cptr_type_node   NULL_TREE
#define c_size_type_node   NULL_TREE
#define const_string_type_node   NULL_TREE
#define traditional_len_type_node   NULL_TREE
#define va_list_ref_type_node   NULL_TREE
#define va_list_arg_type_node   NULL_TREE
#define flag_isoc99   0
#define DEF_PRIMITIVE_TYPE(ENUM, VALUE)   builtin_types[(int) ENUM] = VALUE;
#define DEF_FUNCTION_TYPE_0(ENUM, RETURN)
#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1)
#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2)
#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3)
#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4)
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN)   builtin_types[(int) ENUM] = NULL_TREE;
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1)   builtin_types[(int) ENUM] = NULL_TREE;
#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2)   builtin_types[(int) ENUM] = NULL_TREE;
#define DEF_POINTER_TYPE(ENUM, TYPE)   builtin_types[(int) ENUM] = NULL_TREE;
#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, NONANSI_P)   define_builtin (ENUM, NAME, CLASS, builtin_types[TYPE], FALLBACK_P);

Typedefs

typedef tree
builtin_creator_function 
PARAMS ((tree, tree))

Enumerations

enum  builtin_type {
  BT_SPECLINE = 0, BT_DATE, BT_FILE, BT_BASE_FILE,
  BT_INCLUDE_LEVEL, BT_TIME, BT_STDC, BT_PRAGMA,
  BT_SPECLINE = 0, BT_DATE, BT_FILE, BT_BASE_FILE,
  BT_INCLUDE_LEVEL, BT_TIME, BT_STDC, BT_PRAGMA,
  DEF_PRIMITIVE_TYPE, BT_SPECLINE = 0, BT_DATE, BT_FILE,
  BT_BASE_FILE, BT_INCLUDE_LEVEL, BT_TIME, BT_STDC,
  BT_PRAGMA, BT_SPECLINE = 0, BT_DATE, BT_FILE,
  BT_BASE_FILE, BT_INCLUDE_LEVEL, BT_TIME, BT_STDC,
  BT_PRAGMA, BT_TIMESTAMP
}

Functions/Subroutines

static tree max_builtin PARAMS ((tree, tree))
static void define_builtin PARAMS ((enum built_in_function, const char *, enum built_in_class, tree, int))
static tree define_builtin_type PARAMS ((int, int, int, int, int))
static tree max_builtin (tree method_return_type, tree method_arguments)
static tree min_builtin (tree method_return_type, tree method_arguments)
static tree abs_builtin (tree method_return_type, tree method_arguments)
static tree build_function_call_expr (tree fn, tree arglist)
static tree cos_builtin (method_return_type, tree method_return_type method_arguments)
static tree sin_builtin (method_return_type, tree method_return_type method_arguments)
static tree sqrt_builtin (method_return_type, tree method_return_type method_arguments)
static void define_builtin (enum built_in_function val, const char *name, enum built_in_class class, tree type, int fallback_p)
static tree define_builtin_type (int ret, int arg1, int arg2, int arg3, int arg4)
void initialize_builtins ()
tree check_for_builtin (tree method, tree call)

Variables

static struct builtin_record java_builtins []
static tree builtin_types [(int) BT_LAST]


Define Documentation

#define c_size_type_node   NULL_TREE

#define const_string_type_node   NULL_TREE

#define DEF_BUILTIN ( ENUM,
NAME,
CLASS,
TYPE,
LIBTYPE,
BOTH_P,
FALLBACK_P,
NONANSI_P   )     define_builtin (ENUM, NAME, CLASS, builtin_types[TYPE], FALLBACK_P);

#define DEF_FUNCTION_TYPE_0 ( ENUM,
RETURN   ) 

Value:

builtin_types[(int) ENUM]       \
    = define_builtin_type (RETURN, -1, -1, -1, -1);

#define DEF_FUNCTION_TYPE_0 ( NAME,
RETURN   )     NAME,

#define DEF_FUNCTION_TYPE_1 ( ENUM,
RETURN,
ARG1   ) 

Value:

builtin_types[(int) ENUM]           \
    = define_builtin_type (RETURN, ARG1, -1, -1, -1);

#define DEF_FUNCTION_TYPE_1 ( NAME,
RETURN,
ARG1   )     NAME,

#define DEF_FUNCTION_TYPE_2 ( ENUM,
RETURN,
ARG1,
ARG2   ) 

Value:

builtin_types[(int) ENUM]       \
    = define_builtin_type (RETURN, ARG1, ARG2, -1, -1);

#define DEF_FUNCTION_TYPE_2 ( NAME,
RETURN,
ARG1,
ARG2   )     NAME,

#define DEF_FUNCTION_TYPE_3 ( ENUM,
RETURN,
ARG1,
ARG2,
ARG3   ) 

Value:

builtin_types[(int) ENUM]            \
    = define_builtin_type (RETURN, ARG1, ARG2, ARG3, -1);

#define DEF_FUNCTION_TYPE_3 ( NAME,
RETURN,
ARG1,
ARG2,
ARG3   )     NAME,

#define DEF_FUNCTION_TYPE_4 ( ENUM,
RETURN,
ARG1,
ARG2,
ARG3,
ARG4   ) 

Value:

builtin_types[(int) ENUM]           \
    = define_builtin_type (RETURN, ARG1, ARG2, ARG3, ARG4);

#define DEF_FUNCTION_TYPE_4 ( NAME,
RETURN,
ARG1,
ARG2,
ARG3,
ARG4   )     NAME,

#define DEF_FUNCTION_TYPE_VAR_0 ( ENUM,
RETURN   )     builtin_types[(int) ENUM] = NULL_TREE;

#define DEF_FUNCTION_TYPE_VAR_0 ( NAME,
RETURN   )     NAME,

#define DEF_FUNCTION_TYPE_VAR_1 ( ENUM,
RETURN,
ARG1   )     builtin_types[(int) ENUM] = NULL_TREE;

#define DEF_FUNCTION_TYPE_VAR_1 ( NAME,
RETURN,
ARG1   )     NAME,

#define DEF_FUNCTION_TYPE_VAR_2 ( ENUM,
RETURN,
ARG1,
ARG2   )     builtin_types[(int) ENUM] = NULL_TREE;

#define DEF_FUNCTION_TYPE_VAR_2 ( NAME,
RETURN,
ARG1,
ARG2   )     NAME,

#define DEF_POINTER_TYPE ( ENUM,
TYPE   )     builtin_types[(int) ENUM] = NULL_TREE;

#define DEF_POINTER_TYPE ( NAME,
TYPE   )     NAME,

#define DEF_PRIMITIVE_TYPE ( ENUM,
VALUE   )     builtin_types[(int) ENUM] = VALUE;

#define DEF_PRIMITIVE_TYPE ( NAME,
VALUE   )     NAME,

#define flag_isoc99   0

#define intmax_type_node   NULL_TREE

#define traditional_cptr_type_node   NULL_TREE

#define traditional_len_type_node   NULL_TREE

#define traditional_ptr_type_node   NULL_TREE

#define va_list_arg_type_node   NULL_TREE

Referenced by c_common_nodes_and_builtins(), and GTY().

#define va_list_ref_type_node   NULL_TREE

Referenced by c_common_nodes_and_builtins(), and GTY().


Typedef Documentation

typedef tree builtin_creator_function PARAMS((tree, tree))

Definition at line 82 of file builtins.c.


Enumeration Type Documentation

Enumerator:
BT_SPECLINE 
BT_DATE 
BT_FILE 
BT_BASE_FILE 
BT_INCLUDE_LEVEL 
BT_TIME 
BT_STDC 
BT_PRAGMA 
BT_SPECLINE 
BT_DATE 
BT_FILE 
BT_BASE_FILE 
BT_INCLUDE_LEVEL 
BT_TIME 
BT_STDC 
BT_PRAGMA 
DEF_PRIMITIVE_TYPE 
BT_SPECLINE 
BT_DATE 
BT_FILE 
BT_BASE_FILE 
BT_INCLUDE_LEVEL 
BT_TIME 
BT_STDC 
BT_PRAGMA 
BT_SPECLINE 
BT_DATE 
BT_FILE 
BT_BASE_FILE 
BT_INCLUDE_LEVEL 
BT_TIME 
BT_STDC 
BT_PRAGMA 
BT_TIMESTAMP 

Definition at line 36 of file builtins.c.


Function Documentation

static tree abs_builtin ( tree  method_return_type,
tree  method_arguments 
) [static]

Definition at line 137 of file builtins.c.

References build1, and TREE_VALUE.

static tree build_function_call_expr ( tree  fn,
tree  arglist 
) [static]

Definition at line 146 of file builtins.c.

References build(), build1, build_pointer_type(), TREE_SIDE_EFFECTS, and TREE_TYPE.

tree check_for_builtin ( tree  method,
tree  call 
)

static tree cos_builtin ( method_return_type  ,
tree method_return_type  method_arguments 
) [static]

Definition at line 158 of file builtins.c.

References build_function_call_expr(), built_in_decls, and NULL_TREE.

static void define_builtin ( enum built_in_function  val,
const char *  name,
enum built_in_class  class,
tree  type,
int  fallback_p 
) [static]

static tree define_builtin_type ( int  ret,
int  arg1,
int  arg2,
int  arg3,
int  arg4 
) [static]

Definition at line 223 of file builtins.c.

References args, build_function_type(), builtin_types, NULL_TREE, tree_cons, and void_list_node.

void initialize_builtins (  ) 

static tree max_builtin ( tree  method_return_type,
tree  method_arguments 
) [static]

Definition at line 119 of file builtins.c.

References build(), TREE_CHAIN, and TREE_VALUE.

static tree min_builtin ( tree  method_return_type,
tree  method_arguments 
) [static]

Definition at line 128 of file builtins.c.

References build(), TREE_CHAIN, and TREE_VALUE.

static tree define_builtin_type PARAMS ( (int, int, int, int, int)   )  [static]

static void define_builtin PARAMS ( (enum built_in_function, const char *, enum built_in_class, tree, int)   )  [static]

static tree max_builtin PARAMS ( (tree, tree  )  [static]

static tree sin_builtin ( method_return_type  ,
tree method_return_type  method_arguments 
) [static]

Definition at line 169 of file builtins.c.

References build_function_call_expr(), built_in_decls, and NULL_TREE.

static tree sqrt_builtin ( method_return_type  ,
tree method_return_type  method_arguments 
) [static]

Definition at line 180 of file builtins.c.

References build_function_call_expr(), built_in_decls, and NULL_TREE.


Variable Documentation

tree builtin_types[(int) BT_LAST] [static]

Definition at line 113 of file builtins.c.

Referenced by c_common_nodes_and_builtins(), def_fn_type(), define_builtin_type(), and GTY().

Initial value:

{
  { { "java.lang.Math" }, { "min" }, min_builtin },
  { { "java.lang.Math" }, { "max" }, max_builtin },
  { { "java.lang.Math" }, { "abs" }, abs_builtin },
  { { "java.lang.Math" }, { "cos" }, cos_builtin },
  { { "java.lang.Math" }, { "sin" }, sin_builtin },
  { { "java.lang.Math" }, { "sqrt" }, sqrt_builtin },
  { { NULL }, { NULL }, NULL }
}

Definition at line 100 of file builtins.c.


Generated on Wed Apr 8 15:11:58 2009 for Open64 by  doxygen 1.5.6