aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/builtins.c
AgeCommit message (Collapse)AuthorFilesLines
2003-10-05* builtins.c, jcf.h, jvspec.c: Remove PARAMS macros.Kelley Cook1-1/+1
From-SVN: r72107
2003-09-03builtins.c (enum builtin_type): Delete unused enumeration.Roger Sayle1-27/+0
* builtins.c (enum builtin_type): Delete unused enumeration. * Make-lang.in (java/builtins.o): Remove built-types.def dependency. From-SVN: r71023
2003-06-08builtins.c (define_builtin_type, [...]): Delete.Roger Sayle1-101/+42
* builtins.c (define_builtin_type, builtin_types): Delete. (define_builtin): Rewritten to take just the built-in code, the function's name, type and fallback library function name. All built-ins used by Java are implicit and BUILT_IN_NORMAL. (initialize_builtins): Overhaul to define the GCC builtins used by gcj manually, providing the Java run-time's implementations as the fallback library function. * libjava.lang/MathBuiltin.java: New test case. * libjava.lang/MathBuiltin.out: New file. From-SVN: r67632
2003-05-29builtins.c (cos_builtin, [...]): Delete.Roger Sayle1-53/+34
* builtins.c (cos_builtin, sin_builtin, sqrt_builtin): Delete. (builtin_record): Add an additional builtin_code field to record which GCC built-in corresponds to the Java function. (java_builtins): Add new entries for atan, atan2, exp, log, pow and tan. (max_builtin, min_builtin, abs_builtin): Perform constant folding on the resulting tree. (java_build_function_call_expr): Likewise, perform constant folding on the resulting tree. (initialize_builtins): The NULL creators are now allowed in the java_builtins table, which is now terminated by an entry with builtin_code == END_BUILTINS. (check_for_builtin): Likewise. If the matching creator is NULL, construct the call using java_build_function_call_expr directly with the decl for the corresponding builtin_code. From-SVN: r67225
2003-03-02re PR c++/9367 (error: nonnull argument with extern "C" snprintf prototype)Roger Sayle1-2/+6
PR c++/9367 * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro. (BT_FN_INT_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VAR, BT_FN_INT_CONST_STRING_CONST_STRING_VAR, BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types. * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): Also include the nothrow attribute. (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf, vsnprintf, vscanf, vsscanf): Don't define attributes here. * builtins.def (putchar, puts): Make full C89 built-ins. (snprintf, sprintf, scanf, sscanf, vprintf, vscanf, vsscanf, vsnprintf, vsprintf): New built-ins. * c-common.c (c_common_nodes_and_builtins): Handle new macro DEF_FUNCTION_TYPE_VAR_3. * doc/extend.texi: Document these new built-in functions. * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3. (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3. * g++.old-deja/g++.other/builtins10.C: New test for PR 9367. * gcc.dg/format/attr-5.c: Handle new conflicting types warning. From-SVN: r63650
2003-01-24builtins.c (DEF_BUILTIN): Accept 10 arguments.Jan Hubicka1-4/+7
* builtins.c (DEF_BUILTIN): Accept 10 arguments. (implicit_built_in_decls): New global array. (mathfn_built_in): New global function. (fold_trunc_transparent_mathfn): New static function (expand_builtin_strstr, expand_bultin_strchr, expand_builtin_strpbrk, expand_builtin_strcpy, expand_builtin_strncpy, expand_bultin_strcmp, expand_bultin_strncat, expand_builtin_fputs): Use implicint_built_in_decls. (fold_builtin): Fold floor/trunc/round/ceil/nearbyint. * builtins.def: Fix comments. (DEF_GCC_BUILTIN, DEF_FALLBACK_BUILTIN, DEF_EXT_FALLBACK_BUILTIN, DEF_LIB_BUILTIN, DEF_LIB_ALWAYS_BUILTIN, DEF_EXT_LIB_BUILTIN, DEF_C99_BULTIN, DEF_FRONT_END_LIB_BUILTIN, DEF_EXT_FRONT_END_LIB_BUILTIN): Pass implicit as needed. (DEF_C99_C90RES_BULTIN): New. (*f, *l builtins): Update. * c-common.c (DEF_BUILTIN): Initialize implicit array. (c_expand_builtin_printf, c_expand_builtin_fprintf): Update. * convert.c (strip_float_extensions): New global function. * tree.h (DEF_BUILTIN): Accept 10 arguments. (implicit_built_in_decls, mathfn_built_in, strip_float_extension): Declare. * java/builtins.c (define_builtin): Handle implicit. (DEF_BUILTIN): Update. * tm.texi (TARGET_C99_FUNCTIONS): Document. * defaults.h (TARGET_C99_FUNCTIONS): Default to 0. * config/linux.h (TARGET_C99_FUNCTIONS): Default to 1 when using glibc2. From-SVN: r61738
2003-01-17builtins.c (java_build_function_call_expr): Renamed from ↵Kaveh R. Ghazi1-5/+5
build_function_call_expr. * builtins.c (java_build_function_call_expr): Renamed from build_function_call_expr. All callers changed. From-SVN: r61415
2003-01-12* All Files: Convert to ISO C style function definitions.Kaveh R. Ghazi1-24/+14
From-SVN: r61218
2003-01-09* All Files: Remove PARAMS macro.Kaveh R. Ghazi1-13/+11
From-SVN: r61133
2003-01-01Make-lang.in, [...]: Replace "GNU CC" with "GCC" in the copyright header.Steven Bosscher1-5/+5
* Make-lang.in, boehm.c, buffer.c, buffer.h, builtins.c, class.c, config-lang.in, constants.c, convert.h, decl.c, except.c, expr.c, java-except.h, java-tree.h, javaop.def, jcf-parse.c, jcf-write.c, jv-scan.c, jvgenmain.c, jvspec.c, keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c, lex.c, lex.h, mangle.c, mangle_name.c, parse-scan.y, parse.h, parse.y, typeck.c, verify.c, xref.c, xref.h: Replace "GNU CC" with "GCC" in the copyright header. * check-init.c, gjavah.c, javaop.h, jcf-depend.c, jcf-dump.c, jcf-io.c, jcf-path.c, jcf-reader.c, jcf.h, zextract.c, zipfile.h: These files are "part of GCC". Also say "GCC" not "GNU CC". From-SVN: r60747
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-0/+2
From-SVN: r60174
2002-07-11builtins.def: Make the argument types of abort and exit independent of the ↵Roger Sayle1-2/+0
front-end. 2002-07-10 Roger Sayle <roger@eyesopen.com> Zack Weinberg <zack@codesourcery.com> * builtins.def: Make the argument types of abort and exit independent of the front-end. * java/builtins.c (initialize_builtins): Remove defines that handled C/C++ specific junk hereby removed from builtins.def. * gcc.c-torture/execute/20000217-1.c: Fix usage of "abort". Co-Authored-By: Zack Weinberg <zack@codesourcery.com> From-SVN: r55385
2002-07-06re PR c++/7099 (G++ doesn't set the noreturn attribute on std::exit and ↵Roger Sayle1-1/+3
std::abort) PR c++/7099 * builtin-attrs.def: Define new attribute lists for use in builtins.def. * builtins.def [DEF_BUILTIN]: Modify to take an additional ATTRS argument, an enumerated value defined in builtin-attrs.def that represents the attribute list for the builtins. Modify all builtin functions to pass an appropriate attribute list. Specify "abort", "exit", "_exit" and "_Exit" builtins here with their required noreturn attributes. * tree.h (enum_builtin_function): Ignore the additional parameter to DEF_BUILTIN. * builtins.c (built_in_names): Likewise. * c-common.c: (builtin_function_2): Replace the "int noreturn_p" argument with a tree representing the functions attribute list. Pass this "attrs" argument to builtin_function. No longer handle the noreturn_p processing manually. (built_in_attributes): Move the definitions from builtin-attrs.def before c_common_nodes_and_builtins. (c_common_nodes_and_builtins): Handle the new ATTRS parameter in DEF_BUILTIN, passing it to both builtin_function and the changed builtin_function_2. * doc/extend.texi: Document __builtin_abort, __builtin_exit, __builtin__exit and __builtin__Exit. * java/builtins.c (initialize_builtins): Ignore the additional parameter to DEF_BUILTIN. Handle more C/C++ specific junk in the builtins.def file. From-SVN: r55276
2002-06-04Merge from pch-branch up to tag pch-commit-20020603.Geoffrey Keating1-10/+10
From-SVN: r54232
2002-03-29Makefile.in (convert.o, [...]): Update.Neil Booth1-1/+1
* Makefile.in (convert.o, calls.o, expmed.o): Update. * attribs.c (handle_mode_attribute, handle_vector_size_attribute): Use new hooks. * builtin-types.def (BT_PTRMODE): Update. * c-common.c (type_for_size): Rename c_common_type_for_size. (type_for_mode): Similarly. (shorten_compare, pointer_int_sum, c_common_nodes_and_builtins): Use new hook. * c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New. * c-decl.c (finish_enum, build_enumerator): Use new hooks. * c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * c-typeck.c (common_type, comptypes, default_conversion): Use new hooks. * calls.c: Include langhooks.h. (emit_library_call_value_1): Use new hooks. Avoid redundant calls. * convert.c: Include langhooks.h (convert_to_pointer, convert_to_integer): Use new hooks. * except.c (init_eh): Similarly. * expmed.c: Include langhooks.h. (expand_mult_add): Use new hooks. * expr.c (store_expr, store_constructor, expand_expr, do_jump, try_casesi): Similarly. * fold-const.c (optimize_bit_field_compare, make_range, decode_field_reference, fold_truthop, fold): Similarly. * function.c (assign_stack_local_1, assign_stack_temp_for_type, put_var_into_stack): Similarly. * langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): New. (LANG_HOOKS_TYPES_INITIALIZER): Update. * langhooks.h (lang_hooks_for_types): New hooks. * stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks. * tree.c (get_unwidened, get_narrower): Similarly. * tree.h (type_for_mode, type_for_size): Remove. * varasm.c (force_const_mem): Use new hooks. ada: * gigi.h (type_for_size, type_for_mode): Rename. * misc.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * trans.c (tree_transform): Update. * utils.c (gnat_init_decl_processing, init_gigi_decls, builtin_function, float_type_for_size, signed_or_unsigned_type, build_vms_descriptor, unchecked_convert): Update. (type_for_mode, type_for_size): Rename. * utils2.c (nonbinary_modular_operation): Update. cp: * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks. * decl.c (finish_enum): Similarly. * error.c (dump_type): Similarly. * lex.c (cxx_init): Similarly. * mangle.c (write_builtin_type): Similarly. * typeck.c (comptypes): Similarly. f: * com.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. (type_for_mode, type_for_size): Rename. (signed_or_unsigned_type, signed_type, truthvalue_conversion, unsigned_type): Use new hooks. java: * Make-lang.in (builtins.o): Update. * boehm.c (get_boehm_type_descriptor): Update. * builtins.c: Include langhooks.h. * decl.c (java_init_decl_processing): Update. * java-tree.h (java_type_for_mode, java_type_for_size): New. * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): Redefine. * typeck.c (type_for_mode, type_for_size): Update. objc: * objc-act.c (handle_impent): Update. * objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): Redefine. From-SVN: r51571
2002-03-18re PR java/5876 (jc1 crashes when targeting mingw32)Alexandre Petit-Bianco1-1/+1
2002-03-18 Alexandre Petit-Bianco <apbianco@redhat.com> * builtins.c (define_builtin): Do nothing if `type' is null. Fixes PR java/5876. From-SVN: r50990
2002-03-05builtins.c (cos_builtin): method_return_type ATTRIBUTE_UNUSEDDavid Billinghurst1-3/+3
2002-03-05 David Billinghurst <David.Billinghurst@riotinto.com> * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED * builtins.c(sin_builtin): Likewise * builtins.c(sqrt_builtin): Likewise From-SVN: r50304
2002-02-27c-common.c, [...]: Delete code implementing -traditional mode.Zack Weinberg1-3/+0
* c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in, c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h, cppmacro.c, objc/lang-specs.h, objc/objc-act.c, builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c, gcc.c, toplev.c: Delete code implementing -traditional mode. * ada/misc.c, ch/ch-tree.h, ch/decl.c, cp/decl2.c, f/com.c, f/lex.c, f/top.c, java/builtins.c, java/decl.c: Delete traditional-mode-related code copied from the C front end but not used, or used only to permit the compiler to link. * doc/bugreport.texi, doc/cpp.texi, doc/extend.texi, doc/invoke.texi, doc/standards.texi, doc/trouble.texi: Document removal of -traditional mode for compilation, and remove documentation only relevant to that mode. * config/nextstep.h, config/ptx4.h, config/svr4.h, config/convex/convex.h, config/d30v/d30v.h, config/i386/dgux.h, config/i386/osf1elf.h, config/i386/osfelf.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h, config/m68k/hp310.h, config/m88k/dgux.h, config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c, config/m88k/m88k.h, config/m88k/openbsd.h, config/mips/abi64.h, config/mips/osfrose.h, config/mips/svr4-5.h, config/mips/svr4-t.h, config/sparc/sol2-sld-64.h, config/sparc/sol2.h, config/stormy16/stormy16.h: Remove all references to -traditional from target specs. Delete all mention of the no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also delete a couple of commented-out definitions of DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring to -traditional. * system.h: Poison TRADITIONAL_RETURN_FLOAT. * doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro. * testsuite/gcc.c-torture/execute/920730-1t.c, testsuite/gcc.c-torture/execute/920730-1t.x, testsuite/gcc.dg/ext-glob.c: Delete test cases, only relevant to -traditional. From-SVN: r50110
2002-02-20builtins.c (check_for_builtin): New function.Per Bothner1-22/+10
* builtins.c (check_for_builtin): New function. (build_call_or_builtin): Remove. * java-tree.h: Update accordingly. * expr.c (expand_invoke): Use build + check_for_builtin instead of build_call_or_builtin. * parse.y (patch_invoke): Likewise. This avoids needlessly creating a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER flag (which had caused jcf-write to incorrectly emit invokevirtual). From-SVN: r49909
2002-01-27builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not BUILT_IN_SQRTF.Andreas Tobler1-1/+1
2002-01-26 Andreas Tobler <a.tobler@schweiz.ch> * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not BUILT_IN_SQRTF. From-SVN: r49271
2002-01-22decl.c (java_init_decl_processing): Use add_predefined_file.Tom Tromey1-0/+365
* decl.c (java_init_decl_processing): Use add_predefined_file. Predefine RawData.java. (predef_filenames): Removed. (java_init_decl_processing): Don't register predef_filenames. * jcf-parse.c (add_predefined_file): New function. (predefined_filename_p): Rewrote. (predefined_filename_p): No longer static. * decl.c (java_init_decl_processing): Call initialize_builtins. * Make-lang.in (JAVA_OBJS): Added builtins.o. (java/builtins.o): New target. * builtins.c: New file. * parse.y (patch_invoke): Use build_call_or_builtin. * java-tree.h (build_call_or_builtin): Declare. (initialize_builtins): Declare. (java_set_exception_lang_code): Removed unused declaration. (PREDEF_FILENAMES_SIZE): Removed. (java_tree_index): Added JTI_PREDEF_FILENAMES. (predef_filenames): New define. (add_predefined_file): Declare. (predefined_filename_p): Declare. * expr.c (expand_invoke): Use build_call_or_builtin. From-SVN: r49091