diff options
523 files changed, 15306 insertions, 9671 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt index bed538543d8..58c8b6dac4f 100644 --- a/ChangeLog.melt +++ b/ChangeLog.melt @@ -1,4 +1,7 @@ +2008-03-26 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r133612 + 2008-03-24 Basile Starynkevitch <basile@starynkevitch.net> MELT branch merged with trunk r133512 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1ab32856eb..7b81eb19812 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,292 @@ +2008-03-26 Tom Tromey <tromey@redhat.com> + + * Makefile.in (build/gensupport.o, build/print-rtl.o, + build/read-rtl.o, build/rtl.o, build/gencondmd.o, build/genattr.o, + build/genattrtab.o, build/genautomata.o, build/gencheck.o, + build/gencodes.o, build/genconditions.o, build/genconfig.o, + build/genconstants.o, build/genemit.o, build/genextract.o, + build/genflags.o, build/genmddeps.o, build/genopinit.o, + build/genoutput.o, build/genpeep.o, build/genrecog.o): Depend on + options.h. + +2008-03-26 Richard Guenther <rguenther@suse.de> + + Revert + 2008-03-26 Richard Guenther <rguenther@suse.de> + + * fold-const.c (target.h): Include. + (fold_comparison): Fold comparison of addresses of two decls + that bind locally. Consolidate address folding code. + +2008-03-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * builtins.c (expand_builtin_pow, fold_builtin_cabs, + fold_builtin_sqrt, fold_builtin_cbrt, fold_builtin_logarithm, + fold_builtin_hypot, fold_builtin_pow): Remove uses of dconst3, + dconstsqrt2, dconstthird, dconste and/or dconst10. + * config/i386/i386.c (ix86_emit_swsqrtsf): Likewise. + * emit-rtl.c (dconst3, dconst10, dconstm2, dconstthird, + dconstsqrt2, dconste): Delete. + (init_emit_once): Likewise. Simplify initializing dconstm1. + Constify variable. + * real.c (get_real_const): New. + * real.h (dconst3, dconst10, dconstm2, dconstthird, + dconstsqrt2, dconste): Delete. + (real_value_const, get_real_const): New. + +2008-03-26 H.J. Lu <hongjiu.lu@intel.com> + + * config/i386/cygming.h (BIGGEST_ALIGNMENT): Removed. + + * config/i386/i386.c (ix86_function_arg_boundary): Check + BIGGEST_ALIGNMENT instead of 128. + (setup_incoming_varargs_64): Likewise. + +2008-03-26 Tom Tromey <tromey@redhat.com> + + * Makefile.in (DEPFILES): Add missing '/'. + +2008-03-26 Richard Guenther <rguenther@suse.de> + + * fold-const.c (target.h): Include. + (fold_comparison): Fold comparison of addresses of two decls + that bind locally. Consolidate address folding code. + +2008-03-26 Nick Clifton <nickc@redhat.com> + + PR target/31232 + * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Do + not allow INT+INT as a legitimate addressing mode. + +2008-03-26 Richard Guenther <rguenther@suse.de> + + * tree-flow.h (widen_bitfield): Remove declaration. + * tree-ssa-ccp.c (visit_assignment): Remove unneeded code. + (widen_bitfield): Remove function. + * tree-ssa-dom.c (record_equivalences_from_stmt): Remove unneeded + code. + +2008-03-25 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR target/31558 + * config/rs6000/rs6000-c.c (rs6000_builtin_type_compatible): Handle + error_mark_node's. + +2008-03-25 Richard Sandiford <rsandifo@nildram.co.uk> + + PR rtl-optimization/35232 + * reload1.c (reg_reloaded_call_part_clobbered): Clarify comment. + (forget_old_reloads_1, forget_marked_reloads): Don't clear + reg_reloaded_call_part_clobbered here. + (reload_regs_reach_end_p): New function. + (reload_reg_rtx_for_input): New variable. + (reload_reg_rtx_for_output): Likewise. + (emit_input_reload_insns): Use reloadreg rather than rl->reg_rtx + when reassigning a pseudo register. Load reloadreg from + reload_reg_rtx_for_input, moving the mode and register + calculation to... + (do_input_reload): ...here. Use the mode-adjusted reg_rtx + instead of the original when deciding whether an input reload + would be a no-op or whether an output reload can be deleted. + (emit_output_reload_insns): Use the mode-adjusted reg_rtx + when setting up new_spill_reg_store. Load it from + reload_reg_rtx_for_output, moving the mode and register + calculation to... + (do_output_reload): ...here. Use the mode-adjusted reg_rtx + instead of the original when deciding whether an output reload + would be a no-op. Do the same when modifying insn notes. + Use rtx_equal_p instead of == to compare the registers. + (inherit_piecemeal_p): Take a mode and two register numbers + as argument. + (emit_reload_insns): Clear new_spill_reg_store for every hard + register in the reload register. Remove spill registers + from reg_reloaded_valid before considering whether to record + inheritance information for them. Use reload_reg_rtx_for_output + instead of reg_rtx when recording output reloads. Use + reload_reg_rtx_for_input instead of reg_rtx when recording + input reloads. Set or clear reg_reloaded_call_part_clobbered + at the same time as setting reg_reloaded_valid. + (delete_output_reload): Add a new_reload_reg parameter and use it + instead of rld[j].reg_rtx. + (emit_input_reload_insns, do_input_reload, do_output_reload): Adjust + calls accordingly. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Makefile.in (build/gensupport.o): Depend on insn-modes.h. + (build/genattr.o): Likewise. + (build/genattrtab.o): Likewise. + (build/gencodes.o): Likewise. + (build/genconfig.o): Likewise. + (build/genconstants.o): Likewise. + (build/genemit.o): Likewise. + (build/genextract.o): Likewise. + (build/genflags.o): Likewise. + +2008-03-25 Bob Wilson <bob.wilson@acm.org> + + * config/xtensa/xtensa.c (xtensa_va_start): Use build_int_cst + instead of size_int for integer types. + (xtensa_gimplify_va_arg_expr): Likewise. Convert index to sizetype + to match type of MINUS_EXPR. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * configure: Rebuilt. + * configure.ac (BUILD_DEPMODE): Extract CCDEPMODE from temporary + Makefile. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * config/x-solaris (host-solaris.o): Update. + * config/x-linux (host-linux.o): Update. + * config/x-hpux (host-hpux.o): Update. + * config/x-darwin (host-darwin.o): Update. + * config/v850/t-v850e (v850-c.o): Update. + * config/v850/t-v850 (v850-c.o): Update. + * config/t-vxworks (vxworks.o): Update. + * config/t-sol2 (sol2-c.o, sol2.o): Update. + * config/t-darwin (darwin.o, darwin-c.o, darwin-driver.o): Update. + * config/spu/t-spu-elf (spu-c.o): Update. + (spu.o): Remove. + * config/sh/t-symbian (sh-c.o): Update. + (symbian.o): Update. + * config/sh/t-sh (sh-c.o): Update. + * config/score/t-score-elf (score7.o, score3.o): Update. + * config/rs6000/x-rs6000 (driver-rs6000.o): Update. + * config/rs6000/x-darwin64 (host-ppc64-darwin.o): Update. + * config/rs6000/x-darwin (host-ppc-darwin.o): Update. + * config/rs6000/t-rs6000 (rs6000-c.o): Update. + (rs6000.o): Remove. + * config/m68k/t-uclinux (generated_files): Add sysroot-suffix.h. + * config/m32c/t-m32c (m32c-pragma.o): Update. + * config/ia64/t-ia64 (ia64-c.o): Update. + * config/i386/x-mingw32 (host-mingw32.o): Update. + * config/i386/x-i386 (driver-i386.o): Update. + * config/i386/x-darwin (host-i386-darwin.o): Update. + * config/i386/x-cygwin (host-cygwin.o): Update. + * config/i386/t-nwld (nwld.o): Update. + * config/i386/t-netware (netware.o): Update. + * config/i386/t-interix (winnt.o): Update. + * config/i386/t-cygwin (cygwin1.o, cygwin2.o): Update. + * config/i386/t-cygming (winnt.o, winnt-cxx.o, winnt-stubs.o, + msformat-c.o): Update. + * config/bfin/t-bfin-linux (generated_files): Add + linux-sysroot-suffix.h. + * config/arm/t-wince-pe (pe.o): Update. + * config/arm/t-strongarm-pe (pe.o): Update. + * config/arm/t-pe (pe.o): Update. + * config/arm/t-arm (arm-c.o): Update. + * doc/install.texi (Prerequisites): Require make 3.80. + * Makefile.in: Remove .o targets. + (CCDEPMODE, DEPDIR, depcomp, BUILD_DEPMODE): New variables. + (OBSTACK_H, FIBHEAP_H, PARTITION_H, MD5_H, BCONFIG_H): Remove. + (simple_generated_h, simple_generated_c): Move earlier. + (generated_files): New variable. + (TARGET_H, MACHMODE_H, HOOKS_H, HOSTHOOKS_DEF_H, LANGHOOKS_DEF_H, + TARGET_DEF_H, RTL_BASE_H, RTL_H, PARAMS_H, BUILTINS_DEF, TREE_H, + BASIC_BLOCK_H, GCOV_IO_H, COVERAGE_H, DEMANGLE_H, RECOG_H, + ALIAS_H, EMIT_RTL_H, FLAGS_H, FUNCTION_H, EXPR_H, OPTABS_H, + REGS_H, RA_H, RESOURCE_H, SCHED_INT_H, INTEGRATE_H, CFGLAYOUT_H, + CFGLOOP_H, IPA_UTILS_H, IPA_REFERENCE_H, IPA_TYPE_ESCAPE_H, + CGRAPH_H, DF_H, RESOURCE_H, DDG_H, GCC_H, GGC_H, TIMEVAR_H, + INSN_ATTR_H, C_COMMON_H, C_PRAGMA_H, C_TREE_H, SYSTEM_H, + PREDICT_H, DECNUM_H, MKDEPS_H, SYMTAB_H, TREE_DUMP_H, + TREE_GIMPLE_H, TREE_FLOW_H, TREE_SSA_LIVE_H, PRETTY_PRINT_H, + DIAGNOSTIC_H, C_PRETTY_PRINT_H, SCEV_H, LAMBDA_H, TREE_DATA_REF_H, + VARRAY_H, TREE_INLINE_H, REAL_H, DBGCNT_H, EBIMAP_H): Remove. + (.c.o): Remove. + (COMPILE.base, COMPILE): New variables. + (%.o): New pattern rule. + (ALL_HOST_OBJS): New variable. + (xgcc$(exeext), cpp$(exeext)): Remove extra version.o. + (dummy-checksum.o, cc1-checksum.o): Remove. + (DRIVER_SHLIB): New variable. + (DRIVER_DEFINES): Use it. + (gencondmd.c): Move out of build/. + (s-conditions): Update. + (BUILDCOMPILE.base, BUILDCOMPILE): New variables. + (ALL_BUILD_OBJS): Likewise. + (build/%.o): Use BUILDCOMPILE. + (build/ggc-none.o, build/ggc-none.o, build/min-insn-modes.o, + build/print-rtl.o, build/read-rtl.o, build/rtl.o, build/vec.o, + build/gencondmd.o, build/genattrtab.o, build/genautomata.o, + build/gencheck.o, build/gencodes.o, build/genconditions.o, + build/genconfig.o, build/genconstants.o, build/genemit.o, + build/genextract.o, build/genflags.o, build/genmddeps.o, + build/genopinit.o, build/genoutput.o, build/genpeep.o, + build/genpreds.o, build/genrecog.o, build/gcov-iov.o, + build/gen-protos.o, build/scan.o, build/fix-header.o, + build/scan-decls.o): Simplify. + (collect2.o, c-opts.o, gcc.o, gccspec.o, gcc-options.o, + cppdefault.o, protoize.o, unprotoize.o, intl.o, version.o, + prefix.o, toplev.o): Reduce to variable setting. + (libbackend.o): Use COMPILE. Remove most dependencies. Move later. + ($(out_object_file), gcc-options.o): New targets. + ($(ALL_HOST_OBJS)): New target. Include dependency files. + * configure: Rebuilt. + * configure.ac: Call ZW_CREATE_DEPDIR, ZW_PROG_COMPILER_DEPENDENCIES. + * doc/sourcebuild.texi (Front End Directory): Document new variable. + +2008-03-25 Douglas Gregor <doug.gregor@gmail.com> + + * c-common.c (c_sizeof_or_alignof_type): If we're not allowed to + complain when we hit an error, return ERROR_MARK_NODE. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * config/sh/constraints.md (Pso, Psz): New constraints. + * config/sh/sh.c (print_operand): Add %V and %W operand codes. + * config/sh/sh.md (*andsi3_bclr, *iorsi3_bset): New insns. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * config/sh/sh.c (sh_expand_t_scc): Emit movrt for SH2A if possible. + * config/sh/sh.md (xorsi3_movrt, movrt): New insns. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * config/sh/sh.md (prefetch): Add condition for SH2A target. + (prefetch_sh2a): New. + +2008-03-25 Jayant Sonar <Jayant.sonar@kpitcummins.com> + Naveen.H.S <naveen.hs@kpitcummins.com> + + * config/sh/constraints.md (I28): New constraint. + * config/sh/sh.c (broken_move): Add support for movi20s. + * config/sh/sh.md (movsi_ie): Add the alternative for movi20s. + +2008-03-25 Anil Paranjape <anil.paranjape@kpitcummins.com> + Jayant Sonar <Jayant.sonar@kpitcummins.com> + Naveen.H.S <naveen.hs@kpitcummins.com> + + * config/sh/sh.c (SH_ATTRIBUTES): Define. + (SYMBOL_FLAG_FUNCVEC_FUNCTION): Define. + (print_operand): Handle resbank in %@ operand code. + (sh_encode_section_info): New. + (push_regs): Add conditions for resbank. + (sh_expand_epilogue): Likewise. + (sh_insert_attributes): Likewise. + (sh_attribute_table): Likewise. + (sh_handle_resbank_handler_attribute): New. + (sh2a_handle_function_vector_handler_attribute): New. + (sh2a_is_function_vector_call): New. + (sh2a_get_function_vector_number): New. + (sh2a_function_vector_p): New. + (sh_cfun_resbank_handler_p): New. + * config/sh/sh.md (calli): Emit jsr/n if possible. + (calli_tbr_rel): New. + (calli_pcrel): Emit jsr/n if possible. + (return_i): Emit rts/n if possible. + (call_valuei_tbr_rel): New. + (call_valuei_pcrel): Add condition for SH2A target. + (call_value): Likewise. + * config/sh/sh-protos.h (sh_cfun_resbank_handler_p): Declare. + (sh2a_get_function_vector_number): Likewise. + (sh2a_is_function_vector_call): Likewise. + * doc/extend.texi: Document TBR relative addressing of SH2A. + (resbank): Add description for SH2A. + 2008-03-24 Richard Guenther <rguenther@suse.de> PR c/22371 @@ -335,8 +624,8 @@ 2008-03-19 Richard Guenther <rguenther@suse.de> PR middle-end/35609 - * tree-ssa.c (always_executed): New global flag. - (warn_uninitialized_var): If !always_executed warn with "maybe" + * tree-ssa.c (walk_data): New structure. + (warn_uninitialized_var): If not always_executed warn with "maybe" instead of "is". (execute_early_warn_uninitialized): Compute post-dominators. Initialize always_executed before processing each basic block. diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt index a570da885a5..e773b43d072 100644 --- a/gcc/ChangeLog.melt +++ b/gcc/ChangeLog.melt @@ -1,3 +1,7 @@ + +2008-03-26 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r133612. In particular better Makefile.in with auto dependencies... + 2008-03-26 Basile Starynkevitch <basile@starynkevitch.net> * melt/warm-basilys.bysl: adding compilation of multiapply and of (compile-time) field access... diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index a1547c4fea2..0970d658cba 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080325 +20080326 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7d5a0da4336..1c70f4f9186 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -271,6 +271,12 @@ mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs # UNSORTED # -------- +# Dependency tracking stuff. +CCDEPMODE = @CCDEPMODE@ +DEPDIR = @DEPDIR@ +depcomp = $(SHELL) $(srcdir)/../depcomp +BUILD_DEPMODE = @BUILD_DEPMODE@ + # Some compilers can't handle cc -c blah.c -o foo/blah.o. # In stage2 and beyond, we force this to "-o $@" since we know we're using gcc. OUTPUT_OPTION = @OUTPUT_OPTION@ @@ -285,17 +291,6 @@ ZLIBINC = @zlibinc@ GMPLIBS = @GMPLIBS@ GMPINC = @GMPINC@ -### for MELT/ Basilys -# How to find PPL (Parma Polyhedra Library) -PPLLIBS = @ppllibs@ -PPLINC = @pplinc@ - -# How to file LTDL (LibTool DynLoader) -LTDLLIBS = @ltdllibs@ -LTDLINC = @ltdlinc@ -LTDL_LDFLAGS= @ltdl_ldflags@ -#### end of Basilys stuff - CPPLIB = ../libcpp/libcpp.a CPPINC = -I$(srcdir)/../libcpp/include @@ -313,10 +308,6 @@ TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@ # install-headers-tar, install-headers-cpio or install-headers-cp. INSTALL_HEADERS_DIR = @build_install_headers_dir@ -## similar target to use when installing melt include directory. Either -# install-melt-headers-tar, install-melt-headers-cpio or install-melt-headers-cp. -INSTALL_MELT_HEADERS_DIR = $(patsubst install-headers-%, install-melt-headers-%, $(INSTALL_HEADERS_DIR)) - # Header files that are made available under the same name # to programs compiled with GCC. USER_H = $(srcdir)/ginclude/float.h \ @@ -389,11 +380,7 @@ STRIP_FOR_TARGET := $(shell \ # Where to find some libiberty headers. HASHTAB_H = $(srcdir)/../include/hashtab.h -OBSTACK_H = $(srcdir)/../include/obstack.h SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h -FIBHEAP_H = $(srcdir)/../include/fibheap.h -PARTITION_H = $(srcdir)/../include/partition.h -MD5_H = $(srcdir)/../include/md5.h # Default native SYSTEM_HEADER_DIR, to be overridden by targets. NATIVE_SYSTEM_HEADER_DIR = /usr/include @@ -659,7 +646,7 @@ SFP_MACHINE = LIBCONVERT = # Control whether header files are installed. -INSTALL_HEADERS=install-headers install-mkheaders install-melt-headers +INSTALL_HEADERS=install-headers install-mkheaders # Control whether Info documentation is built and installed. BUILD_INFO = @BUILD_INFO@ @@ -741,13 +728,27 @@ SPECS = specs # GTM_H lists the config files that the generator files depend on, # while TM_H lists the ones ordinary gcc files depend on, which # includes several files generated by those generators. -BCONFIG_H = bconfig.h $(build_xm_file_list) CONFIG_H = config.h $(host_xm_file_list) TCONFIG_H = tconfig.h $(xm_file_list) TM_P_H = tm_p.h $(tm_p_file_list) GTM_H = tm.h $(tm_file_list) TM_H = $(GTM_H) insn-constants.h insn-flags.h options.h +# All generated headers which might be needed while building xgcc +# itself. Generated headers needed by build tools and the like should +# not be mentioned here. +simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h + +simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \ + insn-extract.c insn-opinit.c insn-output.c \ + insn-peep.c insn-recog.c + +generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \ + $(simple_generated_h) $(simple_generated_c) specs.h \ + tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \ + $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h + + # Variables for version information. BASEVER := $(srcdir)/BASE-VER # 4.x.y DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, "" @@ -786,82 +787,9 @@ else REVISION_s := endif -# Shorthand variables for dependency lists. -TARGET_H = $(TM_H) target.h insn-modes.h -MACHMODE_H = machmode.h mode-classes.def insn-modes.h -HOOKS_H = hooks.h $(MACHMODE_H) -HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) -LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H) -TARGET_DEF_H = target-def.h $(HOOKS_H) -RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \ - input.h $(REAL_H) statistics.h vec.h fixed-value.h alias.h -RTL_H = $(RTL_BASE_H) genrtl.h -PARAMS_H = params.h params.def -BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def -TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \ - input.h statistics.h vec.h treestruct.def $(HASHTAB_H) \ - double-int.h alias.h -BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \ - hard-reg-set.h $(PREDICT_H) vec.h $(FUNCTION_H) \ - cfghooks.h $(OBSTACK_H) -GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h -COVERAGE_H = coverage.h $(GCOV_IO_H) -DEMANGLE_H = $(srcdir)/../include/demangle.h -RECOG_H = recog.h -ALIAS_H = alias.h coretypes.h -EMIT_RTL_H = emit-rtl.h -FLAGS_H = flags.h options.h -FUNCTION_H = function.h $(TREE_H) $(HASHTAB_H) -EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H) -OPTABS_H = optabs.h insn-codes.h -REGS_H = regs.h varray.h $(MACHMODE_H) $(OBSTACK_H) $(BASIC_BLOCK_H) $(FUNCTION_H) -RA_H = ra.h $(REGS_H) -RESOURCE_H = resource.h hard-reg-set.h -SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) $(DF_H) -INTEGRATE_H = integrate.h $(VARRAY_H) -CFGLAYOUT_H = cfglayout.h $(BASIC_BLOCK_H) -CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(RTL_H) vecprim.h double-int.h -IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H) -IPA_REFERENCE_H = ipa-reference.h bitmap.h $(TREE_H) -IPA_TYPE_ESCAPE_H = ipa-type-escape.h $(TREE_H) -CGRAPH_H = cgraph.h $(TREE_H) -DF_H = df.h bitmap.h $(BASIC_BLOCK_H) alloc-pool.h -RESOURCE_H = resource.h hard-reg-set.h $(DF_H) -DDG_H = ddg.h sbitmap.h $(DF_H) -GCC_H = gcc.h version.h -GGC_H = ggc.h gtype-desc.h -TIMEVAR_H = timevar.h timevar.def -INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h -C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) -C_PRAGMA_H = c-pragma.h $(CPPLIB_H) -C_TREE_H = c-tree.h $(C_COMMON_H) toplev.h $(DIAGNOSTIC_H) -SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h -PREDICT_H = predict.h predict.def CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \ $(srcdir)/../libcpp/include/cpplib.h -DECNUM_H = $(DECNUM)/decContext.h $(DECNUM)/decDPD.h $(DECNUM)/decNumber.h \ - $(DECNUMFMT)/decimal32.h $(DECNUMFMT)/decimal64.h \ - $(DECNUMFMT)/decimal128.h $(DECNUMFMT)/decimal128Local.h -MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h -SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h -TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) -TREE_GIMPLE_H = tree-gimple.h tree-iterator.h -TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \ - bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h $(TREE_GIMPLE_H) \ - $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) -TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H) vecprim.h -PRETTY_PRINT_H = pretty-print.h input.h $(OBSTACK_H) -DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H) options.h -C_PRETTY_PRINT_H = c-pretty-print.h $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H) -SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H) -LAMBDA_H = lambda.h $(TREE_H) vec.h $(GGC_H) -TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) omega.h graphds.h tree-chrec.h -VARRAY_H = varray.h $(MACHMODE_H) $(SYSTEM_H) coretypes.h $(TM_H) -TREE_INLINE_H = tree-inline.h $(VARRAY_H) pointer-set.h -REAL_H = real.h $(MACHMODE_H) -DBGCNT_H = dbgcnt.h dbgcnt.def -EBIMAP_H = ebitmap.h sbitmap.h # # Now figure out from those variables how to compile and link. @@ -877,7 +805,6 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@ ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@ - # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro # puts -I options in CPPFLAGS, our include files in the srcdir will always # win against random include files in /usr/include. @@ -896,8 +823,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) # How to link with both our special library facilities # and the system's installed libraries. -LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \ - $(PPLLIBS) $(GMPLIBS) $(LTDLLIBS) $(GMPLIBS) +LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) # Any system libraries needed just for GNAT. SYSLIBS = @GNAT_LIBEXC@ @@ -922,11 +848,18 @@ BUILD_ERRORS = build/errors.o # libintl.h will be found in ../intl if we are using the included libintl. INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ -I$(srcdir)/../include @INCINTL@ \ - $(PPLINC) $(LTDLINC) \ $(CPPINC) $(GMPINC) $(DECNUMINC) -.c.o: - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) +COMPILE.base = $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -o $@ +ifeq ($(CCDEPMODE),depmode=gcc3) +COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(*D)/$(DEPDIR)/$(*F).Po +else +COMPILE = source='$<' object='$@' libtool=no \ + DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) $(COMPILE.base) +endif + +%.o: %.c + $(COMPILE) $< # # Support for additional languages (other than C). @@ -1048,6 +981,7 @@ OBJS-common = \ cfgrtl.o \ combine.o \ combine-stack-adj.o \ + @COMPILER_PROBE@ \ convert.o \ coverage.o \ cse.o \ @@ -1277,8 +1211,16 @@ OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive) OBJS-onestep = libbackend.o $(OBJS-archive) -COMPILER_PROBE_OBJ = @COMPILER_PROBE@ -BACKEND = main.o @TREEBROWSER@ $(COMPILER_PROBE_OBJ) libbackend.a $(CPPLIB) $(LIBDECNUMBER) +# This lists all host object files, whether they are included in this +# compilation or not. This is used for dependency tracking. +ALL_HOST_OBJS = $(GCC_OBJS) $(C_OBJS) $(OBJS) libbackend.o \ + @TREEBROWSER@ @COMPILER_PROBE@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \ + $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) \ + $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) \ + mips-tfile.o mips-tdump.o \ + $(PROTO_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) + +BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER) MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ @@ -1290,7 +1232,6 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ protoize$(exeext) unprotoize$(exeext) \ $(SPECS) collect2$(exeext) \ - run-basilys.d \ gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \ *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk @@ -1397,7 +1338,7 @@ endif # $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h # # but tree-check.h doesn't change every time gencheck changes. It would the -# nice if targets that depend on tree-check.h wouldn't be rebuild +# nice if targets that depend on tree-check.h wouldn't be rebuilt # unnecessarily when tree-check.h is unchanged. To make this, tree-check.h # must not be overwritten with a identical copy. One solution is to use a # temporary file @@ -1526,7 +1467,7 @@ all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \ ## Basile Starynkevitch added the melt.encap target for basilys .PHONY: melt.encap start.encap: native xgcc$(exeext) cpp$(exeext) specs \ - libgcc-support melt.encap lang.start.encap @GENINSRC@ srcextra + libgcc-support melt.encap lang.start.encap @GENINSRC@ srcextra # These can't be made until after GCC can run. rest.encap: $(STMP_FIXPROTO) lang.rest.encap # This is what is made with the host's compiler @@ -1558,7 +1499,7 @@ libbackend.a: $(OBJS@onestep@) # to avoid confusion if the current directory is in the path # and CC is `gcc'. It is renamed to `gcc' when it is installed. xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \ - version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) + $(LIBDEPS) $(EXTRA_GCC_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) gccspec.o \ intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) @@ -1566,7 +1507,7 @@ xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \ # The only difference from xgcc is that it's linked with cppspec.o # instead of gccspec.o. cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \ - version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) + $(LIBDEPS) $(EXTRA_GCC_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) cppspec.o \ intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) @@ -1581,19 +1522,15 @@ $(SPECS): xgcc$(exeext) gcc-cross$(exeext): xgcc$(exeext) cp xgcc$(exeext) gcc-cross$(exeext) -dummy-checksum.o : dummy-checksum.c - cc1-dummy$(exeext): $(C_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(LTDL_LDFLAGS) -o $@ $(C_OBJS) dummy-checksum.o \ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) dummy-checksum.o \ $(BACKEND) $(LIBS) $(GMPLIBS) cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1-dummy$(exeext) > $@ -cc1-checksum.o : cc1-checksum.c - cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(LTDL_LDFLAGS) -o $@ $(C_OBJS) cc1-checksum.o \ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) cc1-checksum.o \ $(BACKEND) $(LIBS) $(GMPLIBS) # @@ -1736,72 +1673,11 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) # # Compiling object files from source files. -# Note that dependencies on obstack.h are not written -# because that file is not part of GCC. - -# C language specific files. - -c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(FLAGS_H) $(DIAGNOSTIC_H) $(TM_P_H) -c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) $(TIMEVAR_H) $(C_TREE_H) input.h $(FLAGS_H) toplev.h output.h \ - $(CPPLIB_H) gt-c-parser.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H) \ - vec.h $(TARGET_H) - srcextra: gcc.srcextra lang.srcextra gcc.srcextra: gengtype-lex.c -cp -p $^ $(srcdir) -c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ - intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ - $(MACHMODE_H) - -c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \ - $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \ - opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \ - except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \ - $(DIAGNOSTIC_H) input.h langhooks.h $(TREE_GIMPLE_H) tree-mudflap.h \ - pointer-set.h -c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \ - $(RTL_H) toplev.h $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \ - $(TREE_GIMPLE_H) tree-iterator.h -c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(DIAGNOSTIC_H) \ - $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h \ - c-objc-common.h $(C_PRAGMA_H) c-common.def $(TREE_INLINE_H) -stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ - $(C_COMMON_H) -c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) $(REAL_H) $(SPLAY_TREE_H) \ - $(C_PRAGMA_H) input.h intl.h $(FLAGS_H) toplev.h output.h \ - $(CPPLIB_H) $(TARGET_H) $(TIMEVAR_H) $(TM_P_H) -c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(srcdir)/../libcpp/internal.h \ - $(C_PRAGMA_H) -c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \ - $(FUNCTION_H) $(FLAGS_H) toplev.h $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(VARRAY_H) \ - langhooks.h $(GGC_H) $(TARGET_H) $(C_PRETTY_PRINT_H) c-objc-common.h \ - tree-mudflap.h -c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(FLAGS_H) toplev.h -c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) toplev.h $(C_COMMON_H) convert.h $(C_TREE_H) \ - langhooks.h $(TARGET_H) -c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FUNCTION_H) $(C_PRAGMA_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ - $(C_COMMON_H) $(TARGET_H) gt-c-pragma.h $(CPPLIB_H) $(FLAGS_H) -graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(FLAGS_H) output.h \ - $(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) -sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) -ebitmap.o: ebitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(EBITMAP_H) -sparseset.o: sparseset.c $(SYSTEM_H) sparseset.h - COLLECT2_OBJS = collect2.o tlink.o intl.o version.o COLLECT2_LIBS = @COLLECT2_LIBS@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) @@ -1810,71 +1686,18 @@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS) mv -f T$@ $@ -collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h \ - $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DTARGET_MACHINE=\"$(target_noncanonical)\" \ - -c $(srcdir)/collect2.c $(OUTPUT_OPTION) - -tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(OBSTACK_H) collect2.h intl.h - -# A file used by all variants of C. - -c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) toplev.h output.h $(C_PRAGMA_H) \ - $(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \ - $(DIAGNOSTIC_H) gt-c-common.h langhooks.h $(VARRAY_H) $(RTL_H) \ - $(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \ - intl.h opts.h $(REAL_H) $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \ - $(BUILTINS_DEF) - -c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \ - $(C_TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(REAL_H) \ - $(DIAGNOSTIC_H) tree-iterator.h fixed-value.h - -c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h langhooks.h \ - $(TREE_INLINE_H) $(DIAGNOSTIC_H) intl.h debug.h $(C_COMMON_H) \ - opts.h options.h $(MKDEPS_H) c-incpath.h cppdefault.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@ - -c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h \ - output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) - -# A file used by all variants of C and some other languages. - -attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) $(TM_P_H) \ - $(TARGET_H) langhooks.h $(CPPLIB_H) - -c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \ - $(C_COMMON_H) $(FLAGS_H) toplev.h intl.h $(DIAGNOSTIC_H) alloc-pool.h \ - c-format.h - -c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) \ - $(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) except.h $(FUNCTION_H) \ - langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(TREE_GIMPLE_H) \ - $(VARRAY_H) - -c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(TREE_DUMP_H) - -c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \ - $(C_COMMON_H) output.h toplev.h $(C_PRAGMA_H) $(GGC_H) debug.h \ - langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DHOST_MACHINE=\"$(host)\" -DTARGET_MACHINE=\"$(target)\" \ - $< $(OUTPUT_OPTION) - -c-omp.o : c-omp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FUNCTION_H) $(C_COMMON_H) toplev.h $(TREE_GIMPLE_H) - # Language-independent files. +ifneq ($(SHLIB_LINK),) +ifeq (@enable_shared@,yes) +DRIVER_SHLIB = -DENABLE_SHARED_LIBGCC +else +DRIVER_SHLIB = +endif +else +DRIVER_SHLIB = +endif + DRIVER_DEFINES = \ -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ @@ -1885,23 +1708,7 @@ DRIVER_DEFINES = \ -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \ @TARGET_SYSTEM_ROOT_DEFINE@ \ $(VALGRIND_DRIVER_DEFINES) \ - `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` - -gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \ - Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \ - configargs.h $(OBSTACK_H) opts.h - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(DRIVER_DEFINES) \ - -c $(srcdir)/gcc.c $(OUTPUT_OPTION)) - -gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(DRIVER_DEFINES) \ - -c $(srcdir)/gccspec.c $(OUTPUT_OPTION)) - -cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) + $(DRIVER_SHLIB) gencheck.h : s-gencheck ; @true s-gencheck : Makefile @@ -1936,1032 +1743,15 @@ s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h $(STAMP) $@ -options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h - -gcc-options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(OUTPUT_OPTION) -DGCC_DRIVER options.c - dumpvers: dumpvers.c -ifdef REVISION_s -version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) -else -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) -endif - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ - -DREVISION=$(REVISION_s) \ - -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ - -DBUGURL=$(BUGURL_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) - -gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ - $(FUNCTION_H) insn-config.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ - cselib.h insn-addr.h $(OPTABS_H) libfuncs.h debug.h $(GGC_H) \ - $(CGRAPH_H) $(TREE_FLOW_H) reload.h $(CPP_ID_DATA_H) - -ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ - $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h $(HOSTHOOKS_DEF_H) - -ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H) - -ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \ - $(PARAMS_H) bitmap.h $(VARRAY_H) - -ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ - $(BCONFIG_H) - -stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(GGC_H) gt-stringpool.h $(CPPLIB_H) $(SYMTAB_H) - -prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ - Makefile $(BASEVER) - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) \ - -c $(srcdir)/prefix.c $(OUTPUT_OPTION) - -convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FLAGS_H) convert.h toplev.h langhooks.h $(REAL_H) fixed-value.h - -double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) - -langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) toplev.h $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \ - langhooks.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) intl.h \ - $(TREE_GIMPLE_H) -tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \ - toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \ - $(REAL_H) gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ - $(OBSTACK_H) pointer-set.h fixed-value.h -tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \ - tree-iterator.h tree-pass.h $(DIAGNOSTIC_H) $(REAL_H) fixed-value.h -tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h insn-config.h \ - $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \ - langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) intl.h $(FUNCTION_H) $(TREE_GIMPLE_H) \ - debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \ - ipa-prop.h value-prof.h $(TARGET_H) $(INTEGRATE_H) -print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h -stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(RTL_H) \ - $(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \ - toplev.h -tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \ - $(SYSTEM_H) $(CONFIG_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \ - $(TM_H) coretypes.h $(CGRAPH_H) tree-pass.h $(TIMEVAR_H) \ - gt-tree-ssa-structalias.h $(PARAMS_H) $(ALIAS_H) pointer-set.h $(FUNCTION_H) -tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ - toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) bitmap.h \ - $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \ - $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) -tree-into-ssa.o : tree-into-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ - $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - langhooks.h domwalk.h tree-pass.h $(GGC_H) $(PARAMS_H) $(BASIC_BLOCK_H) \ - bitmap.h $(CFGLOOP_H) $(FLAGS_H) hard-reg-set.h $(HASHTAB_H) \ - $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) vecprim.h -tree-ssa-ter.o : tree-ssa-ter.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(TREE_SSA_LIVE_H) bitmap.h -tree-ssa-coalesce.o : tree-ssa-coalesce.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(TREE_SSA_LIVE_H) bitmap.h $(FLAGS_H) $(HASHTAB_H) toplev.h -tree-outof-ssa.o : tree-outof-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) bitmap.h $(GGC_H) toplev.h -tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) \ - $(DIAGNOSTIC_H) $(TIMEVAR_H) -tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ - langhooks.h $(FLAGS_H) -tree-ssa-phiprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ - langhooks.h $(FLAGS_H) -tree-ssa-ifcombine.o : tree-ssa-ifcombine.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) -tree-ssa-phiopt.o : tree-ssa-phiopt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) langhooks.h $(FLAGS_H) \ - $(DIAGNOSTIC_H) $(TIMEVAR_H) -tree-nrv.o : tree-nrv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(RTL_H) $(FUNCTION_H) $(BASIC_BLOCK_H) $(EXPR_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TREE_DUMP_H) tree-pass.h \ - langhooks.h -tree-ssa-copy.o : tree-ssa-copy.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ - $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(BASIC_BLOCK_H) tree-pass.h langhooks.h tree-ssa-propagate.h $(FLAGS_H) -tree-ssa-propagate.o : tree-ssa-propagate.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \ - tree-ssa-propagate.h vec.h gt-tree-ssa-propagate.h $(FLAGS_H) $(VARRAY_H) -tree-ssa-dom.o : tree-ssa-dom.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ - $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(BASIC_BLOCK_H) domwalk.h tree-pass.h $(FLAGS_H) langhooks.h \ - tree-ssa-propagate.h $(CFGLOOP_H) $(PARAMS_H) $(REAL_H) -tree-ssa-uncprop.o : tree-ssa-uncprop.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) $(BASIC_BLOCK_H) domwalk.h tree-pass.h $(FLAGS_H) \ - langhooks.h tree-ssa-propagate.h $(REAL_H) -tree-ssa-threadedge.o : tree-ssa-threadedge.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h $(CFGLOOP_H) -tree-ssa-threadupdate.o : tree-ssa-threadupdate.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h $(CFGLOOP_H) -tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(TREE_FLOW_H) -tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ - gt-tree-phinodes.h $(RTL_H) toplev.h -domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H) -tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(TREE_SSA_LIVE_H) bitmap.h toplev.h -tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) tree-pass.h \ - $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \ - bitmap.h $(FLAGS_H) $(HASHTAB_H) langhooks.h $(TREE_GIMPLE_H) \ - $(TREE_INLINE_H) -tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \ - alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(HASHTAB_H) $(TREE_GIMPLE_H) \ - $(TREE_INLINE_H) tree-iterator.h tree-ssa-sccvn.h $(PARAMS_H) -tree-ssa-sccvn.o : tree-ssa-sccvn.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \ - alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(HASHTAB_H) $(TREE_GIMPLE_H) \ - $(TREE_INLINE_H) tree-iterator.h tree-ssa-propagate.h tree-ssa-sccvn.h \ - $(PARAMS_H) -tree-vn.o : tree-vn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ - $(TREE_H) $(TREE_FLOW_H) $(HASHTAB_H) langhooks.h tree-pass.h \ - $(TREE_DUMP_H) $(DIAGNOSTIC_H) tree-ssa-sccvn.h -tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(GGC_H) \ - $(BASIC_BLOCK_H) tree-ssa-propagate.h $(FLAGS_H) $(TREE_DUMP_H) \ - $(CFGLOOP_H) $(SCEV_H) tree-chrec.h $(TIMEVAR_H) toplev.h intl.h -tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ - $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h toplev.h \ - tree-ssa-propagate.h $(TREE_INLINE_H) -tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ - $(DIAGNOSTIC_H) toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ - $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) toplev.h \ - tree-ssa-propagate.h -rtl-factoring.o : rtl-factoring.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - coretypes.h $(TM_H) $(BASIC_BLOCK_H) $(GGC_H) $(REGS_H) $(PARAMS_H) $(EXPR_H) \ - addresses.h $(TM_P_H) tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) output.h \ - $(DF_H) -tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(FUNCTION_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) $(DIAGNOSTIC_H) except.h tree-pass.h $(FLAGS_H) langhooks.h \ - $(BASIC_BLOCK_H) hard-reg-set.h -tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) alloc-pool.h \ - $(BASIC_BLOCK_H) bitmap.h $(CFGLOOP_H) $(FIBHEAP_H) $(HASHTAB_H) \ - langhooks.h $(REAL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) tree-iterator.h -tree-nested.o: tree-nested.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \ - $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(TREE_DUMP_H) $(TREE_INLINE_H) \ - tree-iterator.h $(TREE_GIMPLE_H) $(CGRAPH_H) $(EXPR_H) langhooks.h \ - $(GGC_H) gt-tree-nested.h coretypes.h $(TREE_FLOW_H) pointer-set.h -tree-if-conv.o: tree-if-conv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ - $(CFGLOOP_H) $(RTL_H) $(C_COMMON_H) tree-chrec.h $(TREE_DATA_REF_H) \ - $(SCEV_H) tree-pass.h $(DIAGNOSTIC_H) $(TARGET_H) $(TREE_DUMP_H) \ - $(VARRAY_H) -tree-iterator.o : tree-iterator.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - coretypes.h $(GGC_H) tree-iterator.h $(TREE_GIMPLE_H) gt-tree-iterator.h -tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ - $(TREE_INLINE_H) $(HASHTAB_H) pointer-set.h $(FLAGS_H) $(FUNCTION_H) \ - $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h $(TREE_DUMP_H) \ - tree-pass.h $(PARAMS_H) $(CGRAPH_H) $(BASIC_BLOCK_H) hard-reg-set.h \ - $(TREE_GIMPLE_H) -tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TREE_INLINE_H) \ - $(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h toplev.h \ - coretypes.h langhooks.h $(IPA_REFERENCE_H) -tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) except.h langhooks.h \ - $(GGC_H) tree-pass.h coretypes.h $(TIMEVAR_H) $(TM_P_H) pointer-set.h \ - $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h toplev.h -tree-ssa-loop.o : tree-ssa-loop.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(FLAGS_H) $(TREE_INLINE_H) $(SCEV_H) $(BASIC_BLOCK_H) \ - hard-reg-set.h -tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) \ - $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ - domwalk.h $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) tree-pass.h $(BASIC_BLOCK_H) hard-reg-set.h \ - $(TREE_INLINE_H) -tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(FLAGS_H) $(TREE_INLINE_H) $(RECOG_H) insn-config.h $(EXPR_H) \ - gt-tree-ssa-address.h $(GGC_H) tree-affine.h -tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \ - $(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(FLAGS_H) tree-pass.h $(SCEV_H) $(TREE_DATA_REF_H) $(BASIC_BLOCK_H) \ - $(GGC_H) hard-reg-set.h tree-chrec.h intl.h -tree-ssa-loop-ivcanon.o : tree-ssa-loop-ivcanon.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \ - $(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(FLAGS_H) tree-pass.h $(SCEV_H) $(BASIC_BLOCK_H) $(GGC_H) hard-reg-set.h \ - tree-chrec.h -tree-ssa-loop-ch.o : tree-ssa-loop-ch.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(TREE_INLINE_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) hard-reg-set.h -tree-ssa-loop-prefetch.o: tree-ssa-loop-prefetch.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(EXPR_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \ - $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \ - tree-chrec.h toplev.h langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \ - $(OPTABS_H) -tree-predcom.o: tree-predcom.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) \ - $(CFGLOOP_H) $(TREE_FLOW_H) $(GGC_H) $(TREE_DATA_REF_H) $(SCEV_H) \ - $(PARAMS_H) $(DIAGNOSTIC_H) tree-pass.h $(TM_H) coretypes.h tree-affine.h \ - tree-inline.h -tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(EXPR_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \ - $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \ - tree-chrec.h $(VARRAY_H) tree-affine.h pointer-set.h $(TARGET_H) -tree-affine.o : tree-affine.c tree-affine.h $(CONFIG_H) pointer-set.h \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(TREE_GIMPLE_H) \ - output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) -tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ - output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - tree-pass.h $(CFGLAYOUT_H) $(SCEV_H) $(BASIC_BLOCK_H) hard-reg-set.h \ - $(PARAMS_H) $(TREE_INLINE_H) -tree-ssa-loop-im.o : tree-ssa-loop-im.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) domwalk.h \ - $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(REAL_H) $(BASIC_BLOCK_H) \ - hard-reg-set.h -tree-ssa-math-opts.o : tree-ssa-math-opts.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(TIMEVAR_H) tree-pass.h $(TM_H) $(FLAGS_H) \ - alloc-pool.h $(BASIC_BLOCK_H) $(TARGET_H) -tree-ssa-alias-warnings.o : tree-ssa-alias-warnings.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TREE_DUMP_H) \ - $(TREE_FLOW_H) $(PARAMS_H) $(FUNCTION_H) $(EXPR_H) toplev.h \ - tree-ssa-structalias.h tree-ssa-propagate.h langhooks.h alloc-pool.h \ - $(DIAGNOSTIC_H) -tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(TREE_INLINE_H) $(FLAGS_H) \ - $(FUNCTION_H) $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \ - $(TREE_DUMP_H) tree-pass.h $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ - hard-reg-set.h $(TREE_GIMPLE_H) vec.h tree-ssa-structalias.h \ - $(IPA_TYPE_ESCAPE_H) vecprim.h pointer-set.h alloc-pool.h -tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) tree-iterator.h\ - $(BASIC_BLOCK_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) vec.h \ - alloc-pool.h pointer-set.h $(CFGLOOP_H) -tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ - $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \ - $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) $(TREE_INLINE_H) \ - tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) \ - $(BASIC_BLOCK_H) graph.h hard-reg-set.h -c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \ - $(FLAGS_H) langhooks.h toplev.h $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \ - $(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) $(BASIC_BLOCK_H) \ - hard-reg-set.h $(TREE_DUMP_H) $(TREE_INLINE_H) -gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ - $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \ - $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) toplev.h $(OPTABS_H) \ - $(REAL_H) $(SPLAY_TREE_H) -gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ - $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \ - $(HASHTAB_H) toplev.h -omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \ - $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) toplev.h tree-pass.h \ - $(GGC_H) $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H) -tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ - $(TM_H) coretypes.h -omega.o : omega.c omega.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(TREE_H) $(DIAGNOSTIC_H) varray.h tree-pass.h -tree-chrec.o: tree-chrec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(GGC_H) $(TREE_H) $(REAL_H) $(SCEV_H) tree-pass.h $(PARAMS_H) \ - $(DIAGNOSTIC_H) $(CFGLOOP_H) $(TREE_FLOW_H) -tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(REAL_H) $(RTL_H) \ - $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ - $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h \ - gt-tree-scalar-evolution.h -tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - $(TREE_DATA_REF_H) $(SCEV_H) tree-pass.h tree-chrec.h langhooks.h -tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RECOG_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) tree-chrec.h -tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - tree-vectorizer.h $(TREE_DATA_REF_H) $(EXPR_H) $(TARGET_H) -tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(GGC_H) $(OPTABS_H) $(RECOG_H) $(TREE_H) $(RTL_H) \ - $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ - $(TIMEVAR_H) $(CFGLOOP_H) $(TARGET_H) tree-pass.h $(EXPR_H) \ - tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h toplev.h \ - tree-chrec.h -tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - tree-pass.h $(EXPR_H) tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) \ - input.h $(TARGET_H) $(CFGLAYOUT_H) toplev.h tree-chrec.h -tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - tree-pass.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) $(LAMBDA_H) \ - $(TARGET_H) tree-chrec.h $(OBSTACK_H) -tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - tree-pass.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) \ - $(TARGET_H) tree-chrec.h tree-vectorizer.h -tree-parloops.o: tree-parloops.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_FLOW_H) $(TREE_H) $(RTL_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(GGC_H) \ - $(DIAGNOSTIC_H) tree-pass.h $(SCEV_H) langhooks.h gt-tree-parloops.h \ - tree-vectorizer.h -tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FUNCTION_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \ - tree-stdarg.h $(TARGET_H) langhooks.h -tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \ - tree-ssa-propagate.h -tree-gimple.o : tree-gimple.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(EXPR_H) \ - $(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h bitmap.h $(GGC_H) \ - output.h $(TREE_FLOW_H) -tree-mudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \ - $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) \ - gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h \ - $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) toplev.h -tree-nomudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \ - $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ - output.h $(VARRAY_H) langhooks.h tree-mudflap.h $(TM_H) coretypes.h \ - $(GGC_H) gt-tree-mudflap.h tree-pass.h toplev.h -tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) $(DIAGNOSTIC_H) $(REAL_H) $(HASHTAB_H) $(TREE_FLOW_H) \ - $(TM_H) coretypes.h tree-iterator.h tree-chrec.h langhooks.h tree-pass.h \ - value-prof.h fixed-value.h output.h -fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) $(REAL_H) toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) \ - $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h -diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) input.h toplev.h intl.h \ - $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h -opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ - output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \ - $(FLAGS_H) $(PARAMS_H) tree-pass.h $(DBGCNT_H) debug.h -opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h intl.h -targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ - $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h toplev.h \ - $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \ - $(OPTABS_H) - -#### added for Basilys a.k.a. MELT http://gcc.gnu.org/wiki/MiddleEndLispTranslator -## we pass the MELT_PRIVATE_INCLUDE_DIR -basilys.o: basilys.c \ - $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H) $(TREE_H) $(GGC_H) \ - tree-pass.h basilys.h gt-basilys.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DMELT_PRIVATE_INCLUDE_DIR=\"$(melt_private_include_dir)\" \ - -DMELT_SOURCE_DIR=\"$(melt_source_dir)\" \ - -DMELT_GENERATED_DIR=\"$(melt_generated_dir)\" \ - -DMELT_DYNLIB_DIR=\"$(melt_dynlib_dir)\" \ - -DMELT_COMPILE_SCRIPT=\"$(melt_compile_script)\" \ - -c $(srcdir)/basilys.c $(OUTPUT_OPTION) -### end of Basilys stuff - -toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - version.h $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h \ - $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \ - $(RECOG_H) Makefile toplev.h dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \ - value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ - langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \ - $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \ - $(CPPLIB_H) opts.h params.def tree-mudflap.h $(REAL_H) tree-pass.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DTARGET_NAME=\"$(target_noncanonical)\" \ - -c $(srcdir)/toplev.c $(OUTPUT_OPTION) - -passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h \ - $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \ - dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ - graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ - $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ - langhooks.h insn-flags.h $(CFGLAYOUT_H) $(REAL_H) $(CFGLOOP_H) \ - hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h $(TREE_DUMP_H) \ - $(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) \ - gt-passes.h $(DF_H) $(PREDICT_H) - -main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h - -host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - hosthooks.h $(HOSTHOOKS_DEF_H) - -rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(INSN_ATTR_H) insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) \ - $(CONFIG_H) - -rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def toplev.h $(REAL_H) - -print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(FLAGS_H) \ - $(BCONFIG_H) $(REAL_H) -rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ - $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) $(REAL_H) \ - $(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \ - $(DF_H) - -varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \ - output.h $(C_PRAGMA_H) toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ - $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \ - $(CFGLAYOUT_H) $(CGRAPH_H) tree-mudflap.h $(REAL_H) -function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \ - $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ - output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ - gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \ - tree-pass.h $(DF_H) timevar.h vecprim.h -stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) $(FUNCTION_H) insn-config.h hard-reg-set.h $(EXPR_H) \ - libfuncs.h except.h $(RECOG_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ - langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(MACHMODE_H) \ - $(REGS_H) alloc-pool.h -except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) except.h $(FUNCTION_H) $(EXPR_H) libfuncs.h \ - langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ - dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ - $(TARGET_H) $(TM_P_H) tree-pass.h $(TIMEVAR_H) -expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \ - libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \ - typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h reload.h \ - $(GGC_H) langhooks.h intl.h $(TM_P_H) $(REAL_H) $(TARGET_H) \ - tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \ - tree-pass.h $(DF_H) $(DIAGNOSTIC_H) -dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \ - langhooks.h $(GGC_H) gt-dojump.h -builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \ - $(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \ - hard-reg-set.h toplev.h hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \ - libfuncs.h $(REAL_H) langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \ - $(BUILTINS_DEF) $(MACHMODE_H) $(DIAGNOSTIC_H) -calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ - libfuncs.h $(REGS_H) toplev.h output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \ - $(CGRAPH_H) except.h sbitmap.h $(DBGCNT_H) -expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(REAL_H) \ - toplev.h $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H) -explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ - toplev.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \ - $(TARGET_H) output.h -optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \ - $(RECOG_H) reload.h toplev.h $(GGC_H) $(REAL_H) $(TM_P_H) except.h \ - gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H) -dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \ - langhooks.h insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h \ - toplev.h $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h -debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) -sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ - $(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \ - output.h toplev.h $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \ - gt-sdbout.h reload.h $(VARRAY_H) -dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \ - output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \ - libfuncs.h toplev.h dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \ - $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \ - $(MD5_H) input.h $(FUNCTION_H) $(VARRAY_H) -dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \ - gt-dwarf2asm.h dwarf2.h $(SPLAY_TREE_H) $(TARGET_H) -vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \ - $(RTL_H) $(FLAGS_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H) -xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) toplev.h output.h dbxout.h \ - $(GGC_H) $(TARGET_H) debug.h gstab.h xcoff.h -emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \ - $(GGC_H) $(EXPR_H) hard-reg-set.h bitmap.h toplev.h $(BASIC_BLOCK_H) \ - $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h tree-pass.h gt-emit-rtl.h \ - $(REAL_H) $(DF_H) -real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - toplev.h $(TM_P_H) $(REAL_H) -dfp.o : dfp.c dfp.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - toplev.h $(TM_P_H) $(REAL_H) $(DECNUM_H) -fixed-value.o: fixed-value.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) fixed-value.h $(REAL_H) toplev.h -integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \ - $(EXPR_H) $(REAL_H) $(REGS_H) intl.h $(FUNCTION_H) output.h $(RECOG_H) \ - except.h toplev.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \ - gt-integrate.h $(GGC_H) tree-pass.h $(DF_H) -jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) \ - $(REAL_H) except.h $(FUNCTION_H) tree-pass.h $(DIAGNOSTIC_H) \ - toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) \ - $(TIMEVAR_H) $(TARGET_H) -simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h \ - $(RECOG_H) $(EXPR_H) toplev.h output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \ - $(TREE_H) $(TARGET_H) -cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \ - gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \ - $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H) -cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \ - $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \ - $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \ - $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \ - gt-cgraphunit.h -cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(TREE_GIMPLE_H) \ - $(TREE_FLOW_H) tree-pass.h -varpool.o : varpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \ - $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \ - $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \ - $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \ - gt-varpool.h -ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) -ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) ipa-prop.h \ - $(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) -ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - langhooks.h $(TARGET_H) $(CGRAPH_H) ipa-prop.h tree-inline.h tree-dump.h \ - $(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) $(DIAGNOSTIC_H) -matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TARGET_H) $(CGRAPH_H) $(TREE_FLOW_H) $(TM_H) tree-pass.h \ - $(FLAGS_H) $(TREE_H) $(DIAGNOSTIC_H) -ipa-inline.o : ipa-inline.c gt-ipa-inline.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \ - $(DIAGNOSTIC_H) $(FIBHEAP_H) $(PARAMS_H) $(TIMEVAR_H) tree-pass.h \ - $(COVERAGE_H) $(HASHTAB_H) $(RTL_H) -ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ - pointer-set.h $(GGC_H) $(C_COMMON_H) $(TREE_GIMPLE_H) \ - $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) -ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ - pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(C_COMMON_H) \ - $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) - -ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ - pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \ - $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) -ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ - pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(C_COMMON_H) \ - $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) -ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) \ - $(EXPR_H) $(FUNCTION_H) toplev.h $(GGC_H) $(TARGET_H) langhooks.h $(COVERAGE_H) \ - libfuncs.h gt-coverage.h $(HASHTAB_H) $(IPA_TYPE_ESCAPE_H) - -coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ - $(FUNCTION_H) toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \ - $(HASHTAB_H) $(CGRAPH_H) tree-iterator.h -cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(RECOG_H) \ - $(EMIT_RTL_H) toplev.h output.h $(FUNCTION_H) cselib.h $(GGC_H) $(TM_P_H) \ - gt-cselib.h $(PARAMS_H) alloc-pool.h $(HASHTAB_H) $(TARGET_H) -cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ - except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \ - $(DF_H) $(DBGCNT_H) -dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(DF_H) cselib.h \ - $(DBGCNT_H) dce.h timevar.h tree-pass.h $(DBGCNT_H) -dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) timevar.h tree-pass.h \ - alloc-pool.h $(ALIAS_H) dse.h $(OPTABS_H) -fwprop.o : fwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - toplev.h insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \ - output.h $(DF_H) alloc-pool.h $(TIMEVAR_H) tree-pass.h -web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ - $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h -see.o : see.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ - $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(EXPR_H) dce.h -gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(GGC_H) \ - $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ - $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \ - intl.h $(OBSTACK_H) tree-pass.h $(DF_H) $(DBGCNT_H) -resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \ - coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) $(DF_H) \ - $(FUNCTION_H) toplev.h $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) -lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(RECOG_H) \ - $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) output.h $(REAL_H) -mode-switching.o : mode-switching.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(INSN_ATTR_H) $(RECOG_H) $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) \ - output.h tree-pass.h $(TIMEVAR_H) $(REAL_H) $(DF_H) -tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \ - $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H) $(CFGLOOP_H) \ - $(SCEV_H) -tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ - $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \ - tree-ssa-propagate.h $(FLAGS_H) $(TARGET_H) toplev.h -tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \ - $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \ - $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \ - langhooks.h tree-pass.h $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) \ - bitmap.h $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(PARAMS_H) $(TARGET_H) -tree-complex.o : tree-complex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ - $(TM_H) $(RTL_H) $(REAL_H) $(FLAGS_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) \ - tree-iterator.h tree-pass.h tree-ssa-propagate.h $(DIAGNOSTIC_H) -tree-vect-generic.o : tree-vect-generic.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - $(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \ - $(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \ - langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-vect-generic.h $(GGC_H) \ - coretypes.h insn-codes.h -df-core.o : df-core.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h \ - $(TM_P_H) $(FLAGS_H) output.h tree-pass.h -df-problems.o : df-problems.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h $(TM_P_H) \ - $(FLAGS_H) output.h except.h dce.h vecprim.h -df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h $(TM_P_H) \ - $(FLAGS_H) $(TARGET_H) $(TARGET_DEF_H) $(TREE_H) output.h tree-pass.h -regstat.o : regstat.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TM_P_H) $(FLAGS_H) $(REGS_H) output.h except.h hard-reg-set.h \ - $(BASIC_BLOCK_H) $(TIMEVAR_H) $(DF_H) -var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \ - $(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H) \ - $(REGS_H) $(EXPR_H) $(TIMEVAR_H) tree-pass.h -profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) \ - toplev.h $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \ - $(CFGLOOP_H) $(TIMEVAR_H) tree-pass.h -tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ - $(FUNCTION_H) toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \ - tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h $(CGRAPH_H) -value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \ - $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \ - $(TREE_H) $(COVERAGE_H) $(RTL_H) $(GCOV_IO_H) $(TREE_FLOW_H) \ - tree-flow-inline.h $(TIMEVAR_H) tree-pass.h -loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \ - toplev.h $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H) -alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H) -auto-inc-dec.o : auto-inc-dec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) insn-config.h \ - $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) except.h toplev.h $(RECOG_H) \ - $(EXPR_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H) -cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - $(REGS_H) hard-reg-set.h output.h toplev.h $(FUNCTION_H) except.h $(GGC_H) \ - $(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h \ - $(HASHTAB_H) $(DF_H) $(CFGLOOP_H) $(TREE_FLOW_H) -cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) toplev.h $(CFGLOOP_H) -cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) except.h langhooks.h tree-pass.h $(RTL_H) \ - $(DIAGNOSTIC_H) toplev.h $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \ - value-prof.h -cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ - output.h toplev.h $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \ - $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \ - tree-pass.h $(DF_H) -cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \ - $(TIMEVAR_H) $(OBSTACK_H) toplev.h -cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(FUNCTION_H) except.h $(TIMEVAR_H) $(TREE_H) -cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ - toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ - $(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H) \ - $(DF_H) $(DBGCNT_H) -cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \ - $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \ - $(GGC_H) -cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \ - $(OBSTACK_H) output.h graphds.h -graphds.o : graphds.c graphds.h $(CONFIG_H) $(SYSTEM_H) bitmap.h $(OBSTACK_H) \ - coretypes.h vec.h vecprim.h -loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \ - hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \ - output.h intl.h $(DF_H) $(HASHTAB_H) -loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h \ - $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h \ - $(HASHTAB_H) except.h -cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \ - coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) -loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \ - coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H) $(DF_H) -loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) -loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \ - $(OBSTACK_H) -dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) toplev.h \ - $(TIMEVAR_H) graphds.h vecprim.h pointer-set.h -et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - et-forest.h alloc-pool.h $(BASIC_BLOCK_H) -combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(FUNCTION_H) insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \ - rtlhooks-def.h $(BASIC_BLOCK_H) $(RECOG_H) $(REAL_H) hard-reg-set.h \ - toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \ - insn-codes.h $(TIMEVAR_H) tree-pass.h $(DF_H) -regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ - $(RECOG_H) reload.h $(REAL_H) toplev.h $(FUNCTION_H) output.h $(GGC_H) \ - $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-regclass.h $(HASHTAB_H) \ - $(TARGET_H) tree-pass.h $(DF_H) -local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ - output.h $(FUNCTION_H) $(INSN_ATTR_H) toplev.h except.h reload.h $(TM_P_H) \ - $(GGC_H) $(INTEGRATE_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H) -bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(GGC_H) gt-bitmap.h bitmap.h $(OBSTACK_H) -global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \ - insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \ - $(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H) -ra-conflict.o : ra-conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \ - insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \ - $(TIMEVAR_H) vecprim.h $(DF_H) $(RA_H) sbitmap.h -varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ - $(HASHTAB_H) $(BCONFIG_H) $(VARRAY_H) toplev.h -vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h vec.h $(GGC_H) \ - toplev.h -reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \ - hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h toplev.h \ - addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(REAL_H) $(DF_H) -reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ - $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) toplev.h $(TM_P_H) \ - addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \ - $(OBSTACK_H) $(DF_H) $(TARGET_H) dse.h -rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - rtlhooks-def.h $(EXPR_H) $(RECOG_H) -postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REAL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \ - hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \ - $(FUNCTION_H) toplev.h cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \ - $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(DF_H) -postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ - $(TM_P_H) except.h $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \ - $(PARAMS_H) $(TIMEVAR_H) tree-pass.h $(REAL_H) $(DBGCNT_H) -caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \ - addresses.h $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H) $(DF_H) \ - gt-caller-save.h -bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \ - $(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \ - $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h toplev.h \ - $(DF_H) $(GGC_H) -reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ - $(INSN_ATTR_H) except.h $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \ - $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \ - $(TIMEVAR_H) $(TARGET_H) tree-pass.h -alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h \ - $(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) $(FUNCTION_H) cselib.h $(TREE_H) $(TM_P_H) \ - langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \ - $(SPLAY_TREE_H) $(VARRAY_H) $(IPA_TYPE_ESCAPE_H) $(DF_H) tree-pass.h -stack-ptr-mod.o : stack-ptr-mod.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(RTL_H) $(REGS_H) $(EXPR_H) tree-pass.h \ - $(BASIC_BLOCK_H) $(FLAGS_H) output.h $(DF_H) -init-regs.o : init-regs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) $(RTL_H) $(REGS_H) $(EXPR_H) tree-pass.h \ - $(BASIC_BLOCK_H) $(FLAGS_H) $(DF_H) -regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(TIMEVAR_H) tree-pass.h $(DF_H)\ - $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \ - $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h -combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) tree-pass.h \ - $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \ - $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h -ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \ - toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ - $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ - $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) bitmap.h \ - hard-reg-set.h sbitmap.h $(TM_H) -modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TARGET_H) toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ - $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ - $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \ - cfghooks.h $(GCOV_IO_H) hard-reg-set.h $(TM_H) timevar.h tree-pass.h \ - $(DF_H) $(DBGCNT_H) -haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) output.h \ - $(PARAMS_H) $(DBGCNT_H) -sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h \ - $(PARAMS_H) $(TM_P_H) -sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ - $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h $(DBGCNT_H) -sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \ - $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h -sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \ - $(TM_P_H) $(REAL_H) toplev.h tree-pass.h -final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \ - insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \ - except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \ - $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \ - $(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) $(DF_H) vecprim.h $(GGC_H) \ - $(CFGLOOP_H) $(PARAMS_H) -recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \ - $(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \ - addresses.h $(TM_P_H) $(TIMEVAR_H) tree-pass.h hard-reg-set.h $(REAL_H) \ - $(DF_H) $(DBGCNT_H) -reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \ - insn-config.h toplev.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \ - $(BASIC_BLOCK_H) output.h $(VARRAY_H) $(TIMEVAR_H) tree-pass.h \ - $(TARGET_H) vecprim.h $(DF_H) -sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h -predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ - hard-reg-set.h output.h toplev.h $(RECOG_H) $(FUNCTION_H) except.h \ - $(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \ - $(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \ - $(TREE_FLOW_H) tree-pass.h $(EXPR_H) pointer-set.h -lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ - $(RTL_H) $(GGC_H) gt-lists.h -bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \ - $(TARGET_H) $(FUNCTION_H) $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) \ - $(PARAMS_H) toplev.h tree-pass.h -tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \ - $(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) \ - tree-pass.h -cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \ - $(FUNCTION_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \ - $(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) tree-pass.h vecprim.h \ - $(DF_H) -timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TIMEVAR_H) $(FLAGS_H) intl.h toplev.h $(RTL_H) timevar.def -regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ - output.h $(RECOG_H) $(FUNCTION_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \ - addresses.h reload.h toplev.h $(TIMEVAR_H) tree-pass.h $(DF_H) -ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) toplev.h $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \ - $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \ - $(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \ - $(DF_H) $(DBGCNT_H) -lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ - $(TM_H) coretypes.h $(TREE_H) -lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ - $(TM_H) coretypes.h $(TARGET_H) $(TREE_H) -lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ - $(TM_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ - $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ - $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) coretypes.h $(TARGET_H) \ - tree-chrec.h tree-pass.h vec.h vecprim.h $(OBSTACK_H) -params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h -pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H) -hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H) -pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H) \ - $(TREE_H) -errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H) -dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DBGCNT_H) -lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(MACHMODE_H) $(TM_H) $(RTL_H) $(TM_P_H) $(TIMEVAR_H) $(FLAGS_H) \ - insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) $(OBSTACK_H) bitmap.h \ - $(EXPR_H) $(REGS_H) tree-pass.h $(DF_H) - -$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \ - output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \ - $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \ - langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(out_file) $(OUTPUT_OPTION) - # Build auxiliary files that support ecoff format. mips-tfile: mips-tfile.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) -mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) version.h $(srcdir)/../include/getopt.h gstab.h intl.h - mips-tdump: mips-tdump.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) -mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) version.h $(srcdir)/../include/getopt.h stab.def - -# FIXME: writing proper dependencies for this is a *LOT* of work. -libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ - insn-config.h insn-flags.h insn-codes.h insn-constants.h \ - insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DTARGET_NAME=\"$(target_noncanonical)\" \ - -DLOCALEDIR=\"$(localedir)\" \ - -c $(filter %.c,$^) -o $@ \ - -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ - -DREVISION=$(REVISION_s) \ - -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ - -DBUGURL=$(BUGURL_s) -combine - # # Generate header and source files from the machine description, # and compile them. @@ -2981,43 +1771,6 @@ s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext) $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk $(STAMP) s-mddeps -# Header dependencies for generated source files. -genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)\ - $(GGC_H) -insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \ - insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H) -insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \ - insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H) -insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(EXPR_H) $(REAL_H) output.h insn-config.h $(OPTABS_H) \ - reload.h $(RECOG_H) toplev.h $(FUNCTION_H) $(FLAGS_H) hard-reg-set.h \ - $(RESOURCE_H) $(TM_P_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) tm-constrs.h -insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) toplev.h insn-config.h $(RECOG_H) -insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(MACHMODE_H) $(REAL_H) -insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) insn-config.h $(FLAGS_H) $(RECOG_H) $(EXPR_H) \ - $(OPTABS_H) reload.h -insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(GGC_H) $(REGS_H) $(REAL_H) conditions.h \ - hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h \ - $(RECOG_H) $(FUNCTION_H) toplev.h $(FLAGS_H) insn-codes.h $(TM_P_H) \ - $(TARGET_H) tm-constrs.h -insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) output.h insn-config.h $(RECOG_H) except.h \ - $(FUNCTION_H) $(TM_P_H) $(REAL_H) tm-constrs.h -insn-preds.o : insn-preds.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) insn-config.h $(RECOG_H) output.h \ - $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) \ - toplev.h reload.h $(REGS_H) $(REAL_H) tm-constrs.h -insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) insn-config.h $(RECOG_H) output.h $(FLAGS_H) \ - $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) toplev.h \ - reload.h $(REAL_H) tm-constrs.h - # For each of the files generated by running a generator program over # the machine description, the following pair of static pattern rules # runs the generator program only if the machine description has changed, @@ -3066,10 +1819,10 @@ s-check : build/gencheck$(build_exeext) $(STAMP) s-check # gencondmd doesn't use the standard naming convention. -build/gencondmd.c: s-conditions; @true +gencondmd.c: s-conditions; @true s-conditions: $(MD_DEPS) build/genconditions$(build_exeext) $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c - $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.c + $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c gencondmd.c $(STAMP) s-conditions insn-conditions.md: s-condmd; @true @@ -3137,7 +1890,8 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \ $(host_xm_file_list) \ $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \ $(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \ - $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \ + $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h \ + $(srcdir)/libfuncs.h $(srcdir)/../libcpp/include/symtab.h \ $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \ $(srcdir)/fixed-value.h \ $(srcdir)/ipa-reference.h $(srcdir)/output.h $(srcdir)/cfgloop.h \ @@ -3204,84 +1958,68 @@ s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \ # # How to compile object files to run on the build machine. -build/%.o : # dependencies provided by explicit rule later - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o $@ $< - -# Header dependencies for the programs that generate source code. -# These are library modules... -build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h -build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H) \ - gensupport.h -build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GGC_H) -build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \ - $(MACHMODE_H) -build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_BASE_H) -build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) gensupport.h -build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \ - $(RTL_H) $(REAL_H) $(GGC_H) errors.h -build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h vec.h \ - $(GGC_H) toplev.h -build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H) \ - $(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H) \ - $(RESOURCE_H) toplev.h reload.h except.h tm-constrs.h +BUILDCOMPILE.base = $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o $@ +ifeq ($(BUILD_DEPMODE),depmode=gcc3) +BUILDCOMPILE = $(BUILDCOMPILE.base) -MT $@ -MMD -MP -MF build/$(DEPDIR)/$(*F).Po +else +BUILDCOMPILE = source='$<' object='$@' libtool=no \ + DEPDIR=$(DEPDIR) $(BUILD_DEPMODE) $(depcomp) $(BUILDCOMPILE.base) +endif + +ALL_BUILD_OBJS = $(BUILD_RTL) $(BUILD_ERRORS) \ + build/gencondmd.o build/genattr.o build/genattrtab.o \ + build/genautomata.o build/gencheck.o build/genconstants.o \ + build/genemit.o build/genextract.o build/genflags.o \ + build/gengenrtl.o build/gengtype-lex.o build/gengtype-parse.o \ + build/gengtype.o build/genmddeps.o build/genmodes.o \ + build/genopinit.o build/genoutput.o build/genpeep.o \ + build/genpreds.o build/genrecog.o \ + build/gcov-iov.o build/gen-protos.o build/scan.o \ + build/fix-header.o build/scan-decls.o + +build/%.o : %.c bconfig.h + $(BUILDCOMPILE) $< + +# Dependencies on generated headers for various build/ objects. +build/gensupport.o: $(GTM_H) insn-modes.h options.h +build/ggc-none.o: gtype-desc.h +build/min-insn-modes.o: insn-modes.h +build/print-rtl.o: $(GTM_H) insn-modes.h options.h +build/read-rtl.o: $(GTM_H) insn-modes.h options.h +build/rtl.o: $(GTM_H) insn-modes.h gtype-desc.h options.h +build/vec.o: gtype-desc.h +build/gencondmd.o: gencondmd.c $(GTM_H) insn-constants.h $(TM_P_H) \ + tm-constrs.h options.h gtype-desc.h genrtl.h tree-check.h \ + options.h +build/genattr.o: $(GTM_H) insn-modes.h options.h +build/genattrtab.o: $(GTM_H) gtype-desc.h insn-modes.h options.h +build/genautomata.o: insn-modes.h $(GTM_H) options.h +build/gencheck.o: $(GTM_H) gencheck.h options.h +build/gencodes.o: $(GTM_H) insn-modes.h options.h +build/genconditions.o: insn-modes.h options.h +build/genconfig.o: $(GTM_H) insn-modes.h options.h +build/genconstants.o: $(GTM_H) insn-modes.h options.h +build/genemit.o: $(GTM_H) insn-modes.h options.h +build/genextract.o: $(GTM_H) insn-modes.h options.h +build/genflags.o: $(GTM_H) insn-modes.h options.h +build/genmddeps.o: $(GTM_H) insn-modes.h options.h +build/genopinit.o: insn-modes.h $(GTM_H) options.h +build/genoutput.o: insn-modes.h $(GTM_H) options.h +build/genpeep.o: insn-modes.h $(GTM_H) options.h +build/genpreds.o: insn-modes.h $(GTM_H) options.h +build/genrecog.o: insn-modes.h $(GTM_H) options.h +build/gcov-iov.o: $(GTM_H) $(TM_H) +build/gen-protos.o: $(GTM_H) +build/scan.o: $(GTM_H) +build/fix-header.o: xsys-protos.h $(GTM_H) +build/scan-decls.o: $(GTM_H) + # This pulls in tm-pred.h which contains inline functions wrapping up # predicates from the back-end so those functions must be discarded. # No big deal since gencondmd.c is a dummy file for non-GCC compilers. build/gencondmd.o : \ BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS)) -# ...these are the programs themselves. -build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \ - $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \ - gensupport.h -build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \ - $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \ - $(HASHTAB_H) gensupport.h -build/gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(GTM_H) \ - $(SYSTEM_H) coretypes.h $(lang_tree_files) -build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H) -build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h -build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genconstants.o : genconstants.c $(RTL_BASE_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h -build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h vecprim.h -build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h -build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def -build/gengtype-lex.o : gengtype-lex.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) -build/gengtype-parse.o : gengtype-parse.c gengtype.h $(BCONFIG_H) \ - $(SYSTEM_H) -build/gengtype.o : gengtype.c $(BCONFIG_H) $(SYSTEM_H) gengtype.h \ - rtl.def insn-notes.def errors.h double-int.h -build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_BASE_H) errors.h gensupport.h -build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \ - $(HASHTAB_H) machmode.def $(extra_modes_file) -build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h -build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h toplev.h -build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h $(OBSTACK_H) -build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) errors.h gensupport.h - # Compile the programs that generate insn-* from the machine description. # They are compiled with $(CC_FOR_BUILD), and associated libraries, # since they need to run on this machine @@ -3311,13 +2049,6 @@ gengtype-lex.c : gengtype-lex.l -$(FLEX) $(FLEXFLAGS) -o$@ $< # -# Remake internationalization support. -intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DLOCALEDIR=\"$(localedir)\" \ - -c $(srcdir)/intl.c $(OUTPUT_OPTION) - -# # Remake cpp and protoize. PREPROCESSOR_DEFINES = \ @@ -3333,12 +2064,6 @@ PREPROCESSOR_DEFINES = \ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ @TARGET_SYSTEM_ROOT_DEFINE@ -cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - cppdefault.h Makefile - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(PREPROCESSOR_DEFINES) \ - -c $(srcdir)/cppdefault.c $(OUTPUT_OPTION) - # Note for the stamp targets, we run the program `true' instead of # having an empty command (nothing following the semicolon). @@ -3352,20 +2077,6 @@ protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS) unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS) -protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(DRIVER_DEFINES) \ - $(srcdir)/protoize.c $(OUTPUT_OPTION)) - -unprotoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) \ - $(SYSTEM_H) coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - $(DRIVER_DEFINES) \ - $(srcdir)/protoize.c $(OUTPUT_OPTION)) - # This info describes the target machine, so compile with GCC just built. SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \ stmp-int-hdrs @@ -3408,10 +2119,6 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) diff $(srcdir)/protoize.c tmp-proto.c | cat -rm -f tmp-proto.[cs] tmp-proto$(objext) -# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c -build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \ - $(SYSTEM_H) coretypes.h $(TM_H) - build/gcov-iov$(build_exeext): build/gcov-iov.o $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) build/gcov-iov.o -o $@ @@ -3422,11 +2129,6 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE) $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h $(STAMP) s-iov -gcov.o: gcov.c gcov-io.c $(GCOV_IO_H) intl.h $(SYSTEM_H) coretypes.h $(TM_H) \ - $(CONFIG_H) version.h -gcov-dump.o: gcov-dump.c gcov-io.c $(GCOV_IO_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CONFIG_H) - GCOV_OBJS = gcov.o intl.o version.o errors.o gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@ @@ -3592,11 +2294,6 @@ build/gen-protos$(build_exeext): $(GEN_PROTOS_OBJS) ${CC_FOR_BUILD} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ $(GEN_PROTOS_OBJS) $(BUILD_LIBS) -build/gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) errors.h - -build/scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) - xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h \ build/gen-protos$(build_exeext) Makefile sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \ @@ -3617,11 +2314,6 @@ build/fix-header$(build_exeext): build/fix-header.o build/scan-decls.o \ build/fix-header.o c-incpath.o cppdefault.o build/scan-decls.o prefix.o \ build/scan.o $(BUILD_ERRORS) $(LIBS) -build/fix-header.o: fix-header.c $(OBSTACK_H) scan.h errors.h \ - xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H) - -build/scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) - # stmp-fixproto depends on this, not on fix-header directly. # The idea is to make sure fix-header gets built, # but not rerun fixproto after each stage @@ -3934,9 +2626,9 @@ distclean: clean lang.distclean -rm -f cxxmain.c -rm -f gccbug .gdbinit configargs.h -rm -f gcov.pod - -rm -f built-melt-cc-script # Delete po/*.gmo only if we are not building in the source directory. -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi + -rm -rf $(DEPDIR) */$(DEPDIR) -rmdir ada cp f java objc intl po testsuite 2>/dev/null # Get rid of every file that's generated from some other file, except for `configure'. @@ -4521,6 +3213,93 @@ po/gcc.pot: force AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \ $(XGETTEXT) gcc $(srcdir) +# + +# Dependency information. + +# Add flags needed by some particular compilations. +collect2.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) \ + -DTARGET_MACHINE=\"$(target_noncanonical)\" +c-opts.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) @TARGET_SYSTEM_ROOT_DEFINE@ +gcc.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) +gccspec.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) +gcc-options.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DGCC_DRIVER +cppdefault.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(PREPROCESSOR_DEFINES) +protoize.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) +unprotoize.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) -DUNPROTOIZE +# Remake internationalization support. +intl.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DLOCALEDIR=\"$(localedir)\" + +# We need an explicit dependency here, because these are not directly +# included but their contents are included via command line options. +ifdef REVISION_s +version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) +else +version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) +endif + +version.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) \ + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DREVISION=$(REVISION_s) \ + -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ + -DBUGURL=$(BUGURL_s) +prefix.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DPREFIX=\"$(prefix)\" \ + -DBASEVER=$(BASEVER_s) +toplev.o : \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DTARGET_NAME=\"$(target_noncanonical)\" + +#### added for Basilys a.k.a. MELT http://gcc.gnu.org/wiki/MiddleEndLispTranslator +## we pass the MELT_PRIVATE_INCLUDE_DIR +basilys.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) \ + -DMELT_PRIVATE_INCLUDE_DIR=\"$(melt_private_include_dir)\" \ + -DMELT_SOURCE_DIR=\"$(melt_source_dir)\" \ + -DMELT_GENERATED_DIR=\"$(melt_generated_dir)\" \ + -DMELT_DYNLIB_DIR=\"$(melt_dynlib_dir)\" \ + -DMELT_COMPILE_SCRIPT=\"$(melt_compile_script)\" + + +# Special code and dependencies for -combine compilation. +libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ + $(DATESTAMP) $(BASEVER) $(DEVPHASE) + $(COMPILE) \ + -DTARGET_NAME=\"$(target_noncanonical)\" \ + -DLOCALEDIR=\"$(localedir)\" \ + $(filter %.c,$^) \ + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DREVISION=$(REVISION_s) \ + -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \ + -DBUGURL=$(BUGURL_s) -combine + +# A couple object files don't share a base name with their source files. +$(out_object_file): $(out_file) + $(COMPILE) $< +gcc-options.o: options.c + $(COMPILE) $< + +# Make sure generated files are built at the right time. +$(ALL_HOST_OBJS): | $(generated_files) + +# Include the auto-generated dependencies for all host objects. +DEPFILES = \ + $(foreach obj,$(ALL_HOST_OBJS),\ + $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj)))) +-include $(DEPFILES) + +# Include the auto-generated dependencies for all build objects. +-include $(patsubst %.o,build/$(DEPDIR)/%.Po,$(ALL_BUILD_OBJS)) + ################################################################ ## definition for basilys/MELT internal compilation ## see thread http://gcc.gnu.org/ml/gcc/2008-02/msg00632.html diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index b89f4fa3766..48dc579ee88 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -94,9 +94,11 @@ fi m4_include([../config/acx.m4]) m4_include([../config/codeset.m4]) +m4_include([../config/depstand.m4]) m4_include([../config/gettext-sister.m4]) m4_include([../config/iconv.m4]) m4_include([../config/lcmessage.m4]) +m4_include([../config/lead-dot.m4]) m4_include([../config/lib-ld.m4]) m4_include([../config/lib-link.m4]) m4_include([../config/lib-prefix.m4]) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a807aac85af..7d0880d5008 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,638 @@ +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * adaint.c: Fix warnings. + +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * g-dirope.ads, g-dirope.adb: (Dir_Type_Value): Moved to spec. + +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * a-witeio.adb: Fix problem with Current_Output (introduce Self). + Fix problem of status check for null file + +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * s-proinf-irix-athread.ads, s-vxwork-mips.ads, + s-traces.ads, s-vxwork-arm.ads, s-vxwork-ppc.ads, s-vxwork-sparcv9.ads, + s-tasinf-mingw.ads, s-tasinf-linux.ads, s-tasdeb.ads, mlib-tgt.ads, + i-cstrin.ads, uintp.adb, g-catiio.adb, s-vmexta.ads, + s-trafor-default.ads, s-vxwork-m68k.ads: Minor reformatting. Update + comments. + +2008-03-26 Thomas Quinot <quinot@adacore.com> + +PR ada/33688 + + * g-socket.ads, g-socket.adb (Options, Set_Socket_Option, + Get_Socket_Option): Add support for Receive_Packet_Info. + + * g-soccon.ads, g-soccon-tru64.ads, g-soccon-aix.ads, + g-soccon-irix.ads, g-soccon-hpux.ads, g-soccon-solaris.ads, + g-soccon-vms.ads, g-soccon-mingw.ads, g-soccon-freebsd.ads, + g-soccon-hpux-ia64.ads, g-soccon-solaris-64.ads, g-soccon-darwin.ads, + g-soccon-lynxos.ads, g-soccon-linux-64.ads, g-soccon-linux-x86.ads: Add + new constants SO_REUSEPORT and IP_PKTINFO + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * a-taster.adb, s-shasto.adb, s-soflin.adb, s-taasde.adb, s-taenca.adb, + a-sytaco.adb, a-sytaco.ads, a-tasatt.adb, a-taside.adb, + a-intnam-lynxos.ads, a-retide.adb, a-intnam-tru64.ads, a-intnam-aix.ads, + a-intnam-irix.ads, a-intnam-hpux.ads, a-intnam-linux.ads, + a-intnam-solaris.ads, a-caldel-vms.adb, a-intnam-vms.ads, + a-excpol-abort.adb, a-intnam-mingw.ads, s-interr.adb, s-interr.ads, + s-intman.ads, s-gloloc.adb, s-osinte-lynxos-3.ads, + s-interr-sigaction.adb, s-osinte-hpux.ads, s-osinte-solaris-posix.ads, + a-intnam-freebsd.ads, s-osinte-freebsd.ads, s-osinte-lynxos.ads, + s-taspri-lynxos.ads, s-osinte-tru64.ads, s-osinte-tru64.ads, + s-taspri-tru64.ads, s-osinte-aix.ads, s-osinte-irix.ads, + s-osinte-hpux-dce.ads, s-taprop-hpux-dce.adb, s-taspri-hpux-dce.ads, + s-osinte-linux.ads, s-osinte-dummy.ads, s-taprop-dummy.adb, + s-taspri-dummy.ads, s-interr-dummy.adb, s-osinte-solaris.ads, + s-osinte-mingw.ads, s-taprop-solaris.adb, s-taspri-solaris.ads, + s-inmaop-vms.adb, s-interr-vms.adb, s-intman-vms.ads, s-osinte-vms.ads, + s-osinte-vms.ads, s-taprop-vms.adb, s-taspri-vms.ads, + s-taspri-mingw.ads, s-interr-vxworks.adb, s-inmaop-posix.adb, + s-intman-vxworks.ads, s-osinte-vxworks.ads, s-osprim-vxworks.adb, + s-taspri-vxworks.ads, s-taspri-posix.ads, a-caldel.adb, a-calend.adb, + a-elchha.adb, a-dynpri.adb, a-except.adb, a-except.ads, a-interr.ads, + a-textio.adb, a-tigeau.ads, atree.adb, s-taprob.adb, s-taprop.ads, + s-tarest.adb, s-tarest.ads, s-tasini.adb, s-taskin.adb, s-taskin.ads, + s-tasque.adb, s-tasren.adb, s-tasren.ads, s-tassta.adb, s-tassta.ads, + s-tasuti.adb, s-tataat.adb, s-tataat.ads, s-tpoben.adb, s-tpoben.ads, + s-tpobop.adb, s-tpobop.ads, s-tposen.adb, s-tposen.ads, s-valrea.adb, + s-valuti.adb, a-intnam-darwin.ads, s-osinte-darwin.ads, s-solita.adb, + a-ztinau.ads, s-osinte-linux-hppa.ads, a-except-2005.adb, + a-except-2005.ads, a-rttiev.adb, s-osinte-vxworks6.ads, s-regexp.adb, + s-tasloc.adb: Minor reformatting. + Update comments. + Remove "used for" sections from comments. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * s-tpopsp-posix.adb, s-tpopsp-solaris.adb, s-tpopsp-posix-foreign.adb, + s-tpopsp-lynxos.adb, s-tpopde-vms.ads, s-tpopde-vms.adb, + s-tpopsp-vxworks.adb, s-casi16.adb, s-caun16.adb, s-inmaop.ads, + s-tadeca.adb, s-tadeca.ads, s-tadert.adb, s-tadert.ads, s-tpinop.adb, + s-tpinop.ads, s-tporft.adb, a-rbtgso.adb, a-crbtgo.ads, a-crbtgo.adb, + a-crbtgk.ads, a-crbtgk.adb, a-ciorse.adb, a-cihama.ads, a-cihama.adb, + a-cidlli.ads, a-cidlli.adb, a-chtgop.ads, a-chtgop.adb, a-cgcaso.ads, + a-cgcaso.adb, a-cgaaso.adb, a-ciormu.adb, a-cihase.adb, a-swuwha.ads, + a-rbtgso.ads, a-cgaaso.ads, a-cgaaso.ads, a-ciorma.adb, a-chtgke.ads, + a-chtgke.adb, a-llfzti.ads, a-ztenau.adb, a-ztenau.ads, a-stzhas.ads, + a-szbzha.ads, a-szbzha.adb, a-crdlli.ads, a-crdlli.ads, a-crdlli.adb, + i-forbla-darwin.adb, i-forbla.ads, s-regexp.adb, a-nllrar.ads, + a-nlrear.ads, a-nucoar.ads, a-nurear.ads, i-forlap.ads, s-gearop.adb, + s-gearop.ads, s-gecobl.adb, s-gecobl.ads, s-gecola.adb, s-gecola.ads, + s-gerebl.adb, s-gerela.ads, a-swuwha.adb, i-forbla-unimplemented.ads, + double spaced if it fits on one line and otherwise single spaced. + +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * s-taprop-irix.adb, s-taprop-tru64.adb, s-taprop-lynxos.adb, + s-taprop-linux.adb, s-taprop-mingw.adb, s-taprop-vxworks.adb, + s-taprop-posix.adb (Create_Task): Do not attempt to set task priority + or task info if the thread could not be created. + +2008-03-26 Arnaud Charlet <charlet@adacore.com> + + * gnatvsn.ads (Library_Version): Bump to 4.4. + (Current_Year): Bump to 2008. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * ali.ads, ali.adb (Optimize_Alignment_Setting): New field in ALI record + + * bcheck.adb (Check_Consistent_Optimize_Alignment): New procedure + + * debug.adb: Add debug flags d.r and d.v + Add debug flag .T (Optimize_Alignment (Time)) + Add debug flag .S (Optimize_Alignment (Space)) + + * freeze.adb (Freeze_Record_Type): Set OK_To_Reorder_Components + depending on setting of relevant debug flags. + Replace use of Warnings_Off by Has_Warnings_Off + (Freeze_Entity): In circuit for warning on suspicious convention + actuals, do not give warning if subprogram has same entity as formal + type, or if subprogram does not come from source. + (Freeze_Entity): Don't reset Is_Packed for fully rep speced record + if Optimize_Alignment set to Space. + + * frontend.adb: Add call to Sem_Warn.Initialize + Add call to Sem_Warn.Output_Unused_Warnings_Off_Warnings + Reset Optimize_Alignment mode from debug switches .S and .T + + * layout.adb (Layout_Composite_Object): Rewritten for + Optimize_Aligment pragma. + + * lib-writ.ads, lib-writ.adb: New Ox parameter for Optimize_Alignment + mode. + + * opt.ads, opt.adb: (Optimize_Alignment): New global switch + + * par-prag.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. instead, adjustments throughout to accomodate + this change. Add entry for pragma Optimize_Alignment + + * sem_prag.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. + instead, adjustments throughout to accomodate this change. + (Process_Compile_Time_Warning_Or_Error): Use !! for generated msg + (Favor_Top_Level): Use new function Is_Access_Subprogram_Type + Add implementation of pragma Optimize_Alignment + +2008-03-26 Vincent Celier <celier@adacore.com> + + * a-szuzti.adb, a-swuwti.adb, a-suteio.adb (functions Get_Line): + Improve memory usage to avoid use of stack. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * a-teioed.ads: Correct value of Default_Fill + + * a-teioed.adb (Image): Use Fill_Character instead of '*' to fill + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * a-ztexio.adb, a-ztexio.ads, a-witeio.ads, a-witeio.adb: Fix problem + with Current_Output (introduce Self). + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * checks.adb (Ensure_Valid): Capture valid status if possible + (eliminate checks) + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * stand.ads: Deal with reordering of package standard declarations + + * cstand.adb: Put package Standard declarations in proper order + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * einfo.ads, einfo.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. instead. + (OK_To_Reorder_Components): New flag + (Has_Entries): Code cleanup. + (Warnings_Off_Used): New flag + (Warnings_Off_Used_Unmodified): New flag + (Warnings_Off_Used_Unreferenced): New flag + (Has_Warnings_Off): New function + (Has_Unmodified): New function + (Has_Unreferenced): New function + (Is_Trivial_Subprogram): New flag + (Is_Static_Dispatch_Table_Entity): New attribute. + Change name Access_Subprogram_Type_Kind to Access_Subprogram_Kind + (more consistent with other similar names) + (Access_Subprogram_Type): New classification function + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * errout.ads: Document new !! insertion sequence + + * errout.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. instead. + Replace use of Warnings_Off by Has_Warnings_Off + (Error_Msg_Internal): Don't delete warning ending in !! + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * par.adb (Check_No_Right_Paren): Removed no longer used + + * par-ch10.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. instead. + + * par-ch10.adb (P_Subunit): Improvement in error recovery and message + + * par-tchk.adb, par-ch5.adb, par-ch6.adb, par-ch3.adb, + par-ch4.adb: Minor improvements in error recovery and messages. + + * erroutc.adb (Test_Style_Warning_Serious_Msg): Treat style msgs as + non-serious + + * par-ch9.adb: Minor improvements in error recovery and messages + (P_Protected): Better error recovery for "protected type x;" + + * par-util.adb: Minor improvements in error recovery and messages + (Check_No_Right_Paren): Removed no longer used + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * exp_aggr.adb (Replace_Type): When checking for self-reference, verify + that the prefix of an attribute is the type of the aggregate being + expanded. + +2008-03-26 Javier Miranda <miranda@adacore.com> + Robert Dewar <dewar@adacore.com> + + * exp_attr.adb (N_Pragma): Chars field removed. + (Expand_N_Attribute_Reference): If the designated type associated with + attribute 'Unrestricted_Access is a subprogram entity then replace it + by an E_Subprogram_Type itype. + Implement attribute Old + + * sem_attr.ads (Attribute_Class_Array): Move to snames.ads + + * sem_attr.adb (Build_Access_Subprogram_Itype): Add documentation. + Replace call to + New_Internal_Entity by call to Create_Itype to centralize calls + building itypes, ad propagate the convention of the designated + subprogram. In addition, disable the machinery cleaning constant + indications from all entities in current scope when 'Unrestricted_Access + corresponds with a node initializing a dispatch table slot. + (Analyze_Attribute): Parameterless attributes returning a string or a + type will not be called with improper arguments, so we can remove junk + code that was dealing with this case. + Implement attribute Old + + * snames.ads, snames.h, snames.adb: Add entries for attribute Old + Add entry for pragma Optimize_Alignment + New standard names Sync and Synchronize + +2008-03-26 Robert Dewar <dewar@adacore.com> + Arnaud Charlet <charlet@adacore.com> + + * exp_ch11.adb (Expand_At_End_Handler): Set From_At_End flag on raise + stmt. + (No_Exception_Propagation_Active): New function. + (Expand_Exception_Handlers): Use No_Exception_Propagation_Active. + Update comments, and review all uses of No_Exception_Propagation, which + are now correct and in sync with what gigi expects. + + * restrict.ads, restrict.adb (No_Exception_Propagation_Active): New + function. + (Expand_Exception_Handlers): Use No_Exception_Propagation_Active. + Update comments, and review all uses of No_Exception_Propagation, which + are now correct and in sync with what gigi expects. + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * sem_ch3.adb (Access_Definition): If the access type is the return + result of a protected function, create an itype reference for it + because usage will be in an inner scope from the point of declaration. + (Build_Derived_Record_Type): Inherit Reverse_Bit_Order and + OK_To_Reorder_Components. + (Make_Index): If an overloaded range includes a universal integer + interpretation, resolve to Standard.Integer. + (Analyze_Subtype_Indication): Copy Convention to subtype + (Check_Abstract_Interfaces): Complete semantic checks on the legality of + limited an synchronized progenitors in type declaration and private + extension declarations. + + * exp_ch13.adb (Expand_N_Freeze_Entity): If the scope of the entity is a + protected subprogram body, determine proper scope from subprogram + declaration. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * exp_ch4.adb (Expand_N_Op_Concat): Remove special tests for + No_Run_Time_Mode + +2008-03-26 Gary Dismukes <dismukes@adacore.com> + + * exp_ch5.adb (Expand_N_Extended_Return_Statement): Suppress generation + of a heap allocator for a limited unconstrained function return when + resstriction No_Allocators is active. + (Analyze_Allocator): The restriction No_Allocators is now only checked + on allocators that have Comes_From_Source set, as per RM-H.4(7). + + * sem_ch4.adb (Expand_N_Extended_Return_Statement): Suppress generation + of a heap allocator for a limited unconstrained function return when + resstriction No_Allocators is active. + (Analyze_Allocator): The restriction No_Allocators is now only checked + on allocators that have Comes_From_Source set, as per RM-H.4(7). + (Has_Fixed_Op): If the name in a function call is Standard."*" and the + operands are fixed-point types, the universal_fixed predefined operation + is used, regardless of whether the operand type (s) have a primitive + operation of the same name. + +2008-03-26 Javier Miranda <miranda@adacore.com> + + * exp_disp.adb (Make_DT, Make_Secondary_DT): Set attribute + Is_Static_Dispatch_Table + (Build_Dispatch_Tables): Replace calls to Exchange_Entities() by calls + to Exchange_Declarations to exchange the private and full-view. Bug + found working in this issue. + (Expand_Dispatching_Call): Propagate the convention of the subprogram + to the subprogram pointer type. + (Make_Secondary_DT): Replace generation of Prim'Address by + Address (Prim'Unrestricted_Access) + (Make_DT): Replace generation of Prim'Address by + Address (Prim'Unrestricted_Access) + (Make_Disp_*_Bodies): When compiling for a restricted profile, use + simple call form for single entry. + (Make_DT): Handle new contents of Access_Disp_Table (access to dispatch + tables of predefined primitives). + (Make_Secondary_DT): Add support to handle access to dispatch tables of + predefined primitives. + (Make_Tags): Add entities to Access_Dispatch_Table associated with + access to dispatch tables containing predefined primitives. + + * exp_ch6.adb (N_Pragma): Chars field removed, use Chars + (Pragma_Identifier (.. instead, adjustments throughout to accomodate + this change. + (Register_Predefined_DT_Entry): Updated to handle the new contents + of attribute Access_Disp_Table (pointers to dispatch tables containing + predefined primitives). + + * exp_util.ads, exp_util.adb (Corresponding_Runtime_Package): New + subprogram. + (Find_Interface_ADT): Updated to skip the new contents of attribute + Access_Dispatch_Table (pointers to dispatch tables containing predefined + primitives). + + * sem_util.adb (Has_Abstract_Interfaces): Add missing support for + concurrent types. + (Set_Convention): Use new function Is_Access_Subprogram_Type + (Collect_Interfaces_Info): Updated to skip the new contents of attribute + Access_Dispatch_Table (pointers to dispatch tables containing predefined + primitives). + + * exp_atag.ads, exp_atag.adb (Build_Inherit_Predefined_Prims): Improve + expanded code avoiding calls to Build_Predef_Prims. + (Build_Set_Predefined_Prim_Op_Address): Improve expanded code avoiding + call to Build_Get_Predefined_Prim_Op_Address. + +2008-03-26 Javier Miranda <miranda@adacore.com> + + * exp_ch7.adb (Make_Clean): Code cleanup using the new centralized + subprogram Corresponding_Runtime_Package to know the runtime package + that will provide support to a given protected type. + + * exp_ch9.adb (Add_Private_Declarations, + Build_Protected_Subprogram_Call, + Build_Protected_Entry, Build_Simple_Entry_Call, + Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, + Expand_N_Timed_Entry_Call, Make_Initialize_Protection): Code + cleanup using the new centralized subprogram Corresponding_Runtime + Package to know the runtime package that provides support to + a given protected type. + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * exp_pakd.adb (Expand_Bit_Packed_Element_Set): If the component + assignment is within the initialization procedure for a packed array, + and Initialize_Scalars is enabled, compile right-hand side with checks + off, because the value is purposely out of range. + +2008-03-26 Vincent Celier <celier@adacore.com> + + * gnatcmd.adb: Add processing for GNAT SYNC + + * vms_conv.ads: (Command_Type): Add command Sync + + * vms_conv.adb (Initialize): Add Command_List data for new command Sync + + * vms_data.ads: Add entries for -gnatw.w + Add qualifier for gnatstub --header-file option + Add switches for GNAT SYNC + + * prj-attr.ads, prj-attr.adb: Add new package Synchronize for GNAT SYNC + (Add_Package_Name): New procedure + (Package_Name_List): New function + (Initialize): Add known package names to the list + (Register_New_Package): Add the new package name to the list + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * g-pehage.adb, g-regist.adb, g-spipat.ads, g-spipat.adb, + s-asthan.adb, s-parint.adb, s-rpc.adb, s-stchop.adb: Replace + Raise_Exception by "raise with" construct. + +2008-03-26 Pascal Obry <obry@adacore.com> + + * Makefile.in: Add proper GNAT.Serial_Communications implementation on + supported platforms. + + * Makefile.rtl: Add g-sercom.o. + + * impunit.adb: Add g-sercom.adb. + + * s-crtl.ads (open): New routine. + (close): Likewise. + (write): Likewise. + + * s-osinte-mingw.ads (BYTE): New type. + (CHAR): Likewise. + (OVERLAPPED): Likewise. + (GENERIC_READ): New constant. + (GENERIC_WRITE): Likewise. + (OPEN_EXISTING): Likewise. + (PSECURITY_ATTRIBUTES): Removed this type, use anonymous access + type instead. + (CreateFile): New routine. + (WriteFile): Likewise. + (ReadFile): Likewise. + (CloseHandle): Move next to the other file oriented routines. + + * g-sercom.ads: New unit. + + * g-sercom.adb: Default implementation, calls to this unit will raise + a program error exception. + + * g-sercom-mingw.adb, g-sercom-linux.adb: Windows and + GNU/Linux implementations. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * itypes.adb (Create_Itype): Use new name Access_Subprogram_Kind + + * sem_ch13.adb (Validate_Unchecked_Conversion): Give warning for + unchecked conversion for different conventions only for subprogram + pointers or on VMS. + +2008-03-26 Vincent Celier <celier@adacore.com> + + * osint-c.adb (Set_Library_Info_Name): Use canonical case file names + to check if the specified object file is correct. + +2008-03-26 Thomas Quinot <quinot@adacore.com> + + * sem_cat.adb (Validate_RACW_Primitives): Do not rely on + Comes_From_Source to exclude primitives from being checked. We want to + exclude predefined primitives only, so use the appropriate specific + predicate. Also, flag a formal parameter of an anonymous + access-to-subprogram type as illegal for a primitive operation of a + remote access to class-wide type. + +2008-03-26 Vincent Celier <celier@adacore.com> + + * prj-dect.adb (Parse_Package_Declaration): When a package name is not + known, check if it may be a missspelling of a known package name. In + not verbose, not mode, issue warnings only if the package name is a + possible misspelling. + In verbose mode, always issue a warning for a not known package name, + plus a warning if the name is a misspelling of a known package name. + + * prj-part.adb (Post_Parse_Context_Clause): Modify so that only non + limited withs or limited withs are parse during one call. + (Parse_Single_Project): Post parse context clause in two passes: non + limited withs before current project and limited withs after current + project. + + * prj-proc.adb (Imported_Or_Extended_Project_From): Returns an extended + project with the name With_Name, even if it is only extended indirectly. + (Recursive_Process): Process projects in order: first single withs, then + current project, then limited withs. + + * prj-tree.adb (Imported_Or_Extended_Project_Of): Returns an extended + project with the name With_Name, even if it is only extended indirectly. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * scn.adb (Initialize_Scanner): Format messages belong on standard error + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * sem_ch10.adb (Analyze_Compilation_Unit): if a unit in the context is + a generic subprogram that is imported, do not attempt to compile + non-existent body. + + * sem_ch12.adb (Instantiate_Subprogram_Body): if the generic is + imported, do not generate a raise_program_error for the non-existent + body. + (Pre_Analyze_Actuals): If an error is detected during pre-analysis, + perform minimal name resolution on the generic to avoid spurious + warnings. + (Find_Actual_Type): the designated type of the actual in a child unit + may be declared in a parent unit without being an actual. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * sem_ch11.adb: Fix No_Exception_Restriction violation for SJLJ + * sinfo.ads, sinfo.adb (From_At_End): New flag + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * sem_ch6.adb (Analyze_Subprogram_Body): Remove spurious check on + operations that have an interface parameter. + (Analyze_Subprogram_Body): Set Is_Trivial_Subprogram flag + Don't treat No_Return call as raise. + + * sem_disp.adb (Check_Dispatching_Operations): apply check for + non-primitive interface primitives to access parameters, not to all + parameters of an access type. + +2008-03-26 Ed Schonberg <schonberg@adacore.com> + + * sem_ch7.adb (Install_Parent_Private_Declarations): If the private + declarations of a parent unit are made visible when compiling a child + instance, the parent is not a hidden open scope, even though it may + contain other pending instance. + + * sem_ch8.adb (Restore_Scope_Stack): If an entry on the stack is a + hidden open scope for some child instance, it does affect the + visibility status of other stach entries. + (Analyze_Object_Renaming): Check that a class-wide object cannot be + renamed as an object of a specific type. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * sem_res.adb (Check_Infinite_Recursion): Diagnose definite infinite + recursion and raise SE directly. + (Resolve_Actuals): Reset Never_Set_In_Source if warnings off is + set for formal type for IN mode parameter. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * sem_warn.ads, sem_warn.adb (Warnings_Off_Pragmas): New table + (Initialize): New procedure + (Output_Warnings_Off_Warnings): New procedure + (Check_References): Suppress certain msgs if Is_Trivial_Subprogram + (Output_Non_Modifed_In_Out_Warnings): Ditto + (Warn_On_Unreferenced_Entity): Ditto + +2008-03-26 Vincent Celier <celier@adacore.com> + + * a-direct.adb (Start_Search): Raise Use_Error if the directory is not + readable. + +2008-03-26 Matthew Heaney <heaney@adacore.com> + + * a-ciorse.ads, a-cidlli.ads, a-cdlili.ads, a-cihase.ads, a-cohase.ads, + a-ciorma.ads, a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-coorse.ads: + Marked with clauses as private, and controlled operations as overriding + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * g-byorma.adb (Read_BOM): Reorder tests so that UTF_32 is recognized + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * back_end.adb, back_end.ads: Minor reformatting + + * bindgen.adb: Minor clarification of comments + + * fname.ads: Minor comment fixes + + * g-altive.ads, g-catiio.ads, g-trasym.ads, prj.ads, + prj-nmsc.adb, sem_aggr.adb: Minor reformatting + + * xeinfo.adb, xnmake.adb, xsinfo.adb, xtreeprs.adb, + xsnames.adb: Remove warnings off pragma no longer needed + + * a-catizo.ads, a-calari.ads, a-calfor.adb, + a-calfor.ads: Fix header. + +2008-03-26 Tristan Gingold <gingold@adacore.com> + + * init.c: Do not adjust pc for HPARITH on alpha/vms. + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * lib-xref.adb: (OK_To_Set_Reference): New function + (Generate_Reference): Don't set referenced from occurrence in Warnings, + Unmodified, or Unreferenced pragma + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * alloc.ads: Add entries for Warnings_Off_Pragmas table + +2008-03-26 GNAT Script <nobody@adacore.com> + + * Make-lang.in: Makefile automatically updated + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * tbuild.ads, tbuild.adb, trans.c, sprint.adb, exp_prag.adb, decl.c, + par-ch2.adb, sem_elab.adb, sem_util.ads (N_Pragma): Chars field + removed, use Chars (Pragma_Identifier (.. instead, adjustments + throughout to accomodate this change. + + * s-pooglo.ads, s-pooloc.ads: Minor comment updates + + * exp_dbug.adb: Use Sem_Util.Set_Debug_Info_Needed (not + Einfo.Set_Needs_Debug_Info) + +2008-03-26 Robert Dewar <dewar@adacore.com> + + * gnat_ugn.texi: Add documentation for -gnatw.w/-gnatw.W + Add description for the new gnatstub option '--header-file' + clarification of -gnatwz/-gnatwZ + Add a "Irix-Specific Considerations" section to document the need to + set LD_LIBRARY_PATH when using the default shared runtime library. + Added documentation for both gcov and gprof. + + * gnat_rm.texi: Document that pragma Compile_Time_Warning generates + messages that are not suppressed when clients are compiled. + Add documentation of s-pooglo s-pooloc + Document the new GNAT.Serial_Communications API. + Add documentation for 'Old attribute + Add description of pragma Optimize_Alignment + + * ug_words: Add entries for -gnatw.w -gnatw.W + + * usage.adb: Add line for -gnatw.w (warn on warnings off) + +2008-03-25 Eric Botcazou <ebotcazou@adacore.com> + + Revert + 2008-03-05 Eric Botcazou <ebotcazou@adacore.com> + PR ada/35186 + * decl.c (maybe_pad_type): Avoid padding an integral type when + bumping its alignment is sufficient. + 2008-03-25 Arnaud Charlet <charlet@adacore.com> * exp_ch6.adb, exp_disp.adb: Update copyright notice. diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in index dfc149378f9..83ad1aa2b8f 100644 --- a/gcc/ada/Make-lang.in +++ b/gcc/ada/Make-lang.in @@ -1968,22 +1968,22 @@ ada/exp_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \ - ada/sem_attr.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \ - ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ - ada/stylesw.ads ada/system.ads ada/s-carun8.ads ada/s-crc32.ads \ - ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ - ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \ - ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ - ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \ - ada/s-sopco5.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ - ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ - ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ - ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \ - ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \ - ada/validsw.ads ada/widechar.ads + ada/sem_attr.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \ + ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \ + ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \ + ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \ + ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \ + ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads \ + ada/s-sopco4.ads ada/s-sopco5.ads ada/s-string.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads \ + ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \ + ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads ada/exp_dist.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ @@ -3266,14 +3266,14 @@ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/erroutc.ads ada/exp_dist.ads ada/exp_tss.ads ada/exp_util.ads \ ada/fname.ads ada/fname-uf.ads ada/get_targ.ads ada/gnat.ads \ ada/g-hesorg.ads ada/g-hesorg.adb ada/g-htable.ads ada/hostparm.ads \ - ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \ - ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/nlists.ads \ - ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ - ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \ - ada/sem.ads ada/sem_ch13.ads ada/sem_ch13.adb ada/sem_ch7.ads \ - ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_res.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ + ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \ + ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \ + ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \ + ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \ + ada/rtsfind.adb ada/sem.ads ada/sem_ch13.ads ada/sem_ch13.adb \ + ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads \ + ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \ + ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ @@ -3547,21 +3547,21 @@ ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_attr.ads \ - ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_disp.adb \ - ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \ - ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ - ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \ - ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \ - ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \ - ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ - ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-strops.ads \ - ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads ada/s-string.ads \ - ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ - ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \ - ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \ - ada/urealp.ads ada/validsw.ads ada/widechar.ads + ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \ + ada/sem_disp.adb ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \ + ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb \ + ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \ + ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \ + ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \ + ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ + ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ + ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads \ + ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \ + ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ + ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \ + ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ + ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads ada/sem_dist.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in index 28699267690..c27e7e216a1 100644 --- a/gcc/ada/Makefile.in +++ b/gcc/ada/Makefile.in @@ -837,6 +837,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) s-osprim.adb<s-osprim-posix.adb \ s-taspri.ads<s-taspri-posix.ads \ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \ + g-sercom.adb<g-sercom-linux.adb \ system.ads<system-linux-x86.ads ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),) @@ -1247,7 +1248,6 @@ endif i-cpoint.ads<i-cpoint-vms_64.ads \ i-cpoint.adb<i-cpoint-vms_64.adb \ i-cstrea.adb<i-cstrea-vms.adb \ - i-forbla.ads<i-forbla-unimplemented.ads \ s-inmaop.adb<s-inmaop-vms.adb \ s-interr.adb<s-interr-vms.adb \ s-intman.adb<s-intman-vms.adb \ @@ -1315,7 +1315,8 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),) g-socthi.adb<g-socthi-mingw.adb \ g-stsifd.adb<g-stsifd-sockets.adb \ g-soccon.ads<g-soccon-mingw.ads \ - g-soliop.ads<g-soliop-mingw.ads + g-soliop.ads<g-soliop-mingw.ads \ + g-sercom.adb<g-sercom-mingw.adb ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS += \ @@ -1376,6 +1377,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),) s-tasinf.adb<s-tasinf-linux.adb \ s-taspri.ads<s-taspri-posix.ads \ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \ + g-sercom.adb<g-sercom-linux.adb \ system.ads<system-linux-ppc.ads TOOLS_TARGET_PAIRS = \ @@ -1487,6 +1489,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),) s-tasinf.adb<s-tasinf-linux.adb \ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \ s-taspri.ads<s-taspri-posix.ads \ + g-sercom.adb<g-sercom-linux.adb \ system.ads<system-linux-ia64.ads TOOLS_TARGET_PAIRS = \ @@ -1545,6 +1548,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) s-tasinf.adb<s-tasinf-linux.adb \ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \ s-taspri.ads<s-taspri-posix.ads \ + g-sercom.adb<g-sercom-linux.adb \ system.ads<system-linux-x86_64.ads TOOLS_TARGET_PAIRS = \ diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 7ae43888f28..9eaa7070d1b 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -360,6 +360,7 @@ GNATRTL_NONTASKING_OBJS= \ g-rannum$(objext) \ g-regexp$(objext) \ g-regpat$(objext) \ + g-sercom$(objext) \ g-sestin$(objext) \ g-sha1$(objext) \ g-soccon$(objext) \ diff --git a/gcc/ada/a-calari.ads b/gcc/ada/a-calari.ads index 95967a6e851..f874abe9ecc 100644 --- a/gcc/ada/a-calari.ads +++ b/gcc/ada/a-calari.ads @@ -6,32 +6,12 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2005-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 2005-2007, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ @@ -50,10 +30,10 @@ package Ada.Calendar.Arithmetic is .. +(366 * (1 + Year_Number'Last - Year_Number'First)); - -- Negative leap seconds occur whenever the astronomical time is faster - -- than the atomic time or as a result of Difference when Left < Right. - subtype Leap_Seconds_Count is Integer range -2047 .. 2047; + -- Count of leap seconds. Negative leap seconds occur whenever the + -- astronomical time is faster than the atomic time or as a result of + -- Difference when Left < Right. procedure Difference (Left : Time; diff --git a/gcc/ada/a-caldel-vms.adb b/gcc/ada/a-caldel-vms.adb index b58e17e39e6..ed52533d081 100644 --- a/gcc/ada/a-caldel-vms.adb +++ b/gcc/ada/a-caldel-vms.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,10 +35,7 @@ -- This is the Alpha/VMS version with System.OS_Primitives; --- Used for Max_Sensible_Delay - with System.Soft_Links; --- Used for Timed_Delay package body Ada.Calendar.Delays is diff --git a/gcc/ada/a-caldel.adb b/gcc/ada/a-caldel.adb index d2b701e815f..3410b6135fe 100644 --- a/gcc/ada/a-caldel.adb +++ b/gcc/ada/a-caldel.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2006, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,17 +33,9 @@ ------------------------------------------------------------------------------ with System.OS_Primitives; --- Used for Delay_Modes --- Max_Sensible_Delay - with System.Soft_Links; --- Used for Timed_Delay - with System.Traces; --- Used for Send_Trace_Info - with System.Parameters; --- used for Runtime_Traces package body Ada.Calendar.Delays is diff --git a/gcc/ada/a-calend.adb b/gcc/ada/a-calend.adb index b897fa762ac..1fe977d68a4 100644 --- a/gcc/ada/a-calend.adb +++ b/gcc/ada/a-calend.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,7 +34,6 @@ with Ada.Unchecked_Conversion; with System.OS_Primitives; --- used for Clock package body Ada.Calendar is diff --git a/gcc/ada/a-calfor.adb b/gcc/ada/a-calfor.adb index 8d907ea73ea..65645b2fba8 100644 --- a/gcc/ada/a-calfor.adb +++ b/gcc/ada/a-calfor.adb @@ -34,8 +34,6 @@ with Ada.Calendar; use Ada.Calendar; with Ada.Calendar.Time_Zones; use Ada.Calendar.Time_Zones; -pragma Warnings (Off); -- temp till we fix out param warnings ??? - package body Ada.Calendar.Formatting is -------------------------- diff --git a/gcc/ada/a-calfor.ads b/gcc/ada/a-calfor.ads index 66fcdb1a987..f1497d1498f 100644 --- a/gcc/ada/a-calfor.ads +++ b/gcc/ada/a-calfor.ads @@ -6,32 +6,12 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2005-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 2005-2007, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ diff --git a/gcc/ada/a-catizo.ads b/gcc/ada/a-catizo.ads index decdf52b117..968585bb161 100644 --- a/gcc/ada/a-catizo.ads +++ b/gcc/ada/a-catizo.ads @@ -6,32 +6,12 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2005-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 2005-2007, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ @@ -47,9 +27,8 @@ package Ada.Calendar.Time_Zones is Unknown_Zone_Error : exception; function UTC_Time_Offset (Date : Time := Clock) return Time_Offset; - -- Returns, as a number of minutes, the difference between the - -- implementation-defined time zone of Calendar, and UTC time, at the time - -- Date. If the time zone of the Calendar implementation is unknown, then - -- Unknown_Zone_Error is raised. + -- Returns (in minutes), the difference between the implementation-defined + -- time zone of Calendar, and UTC time, at the time Date. If the time zone + -- of the Calendar implementation is unknown, raises Unknown_Zone_Error. end Ada.Calendar.Time_Zones; diff --git a/gcc/ada/a-cdlili.ads b/gcc/ada/a-cdlili.ads index e8a0488b2b4..c5a6149283e 100644 --- a/gcc/ada/a-cdlili.ads +++ b/gcc/ada/a-cdlili.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -33,8 +33,8 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Finalization; -with Ada.Streams; +private with Ada.Finalization; +private with Ada.Streams; generic type Element_Type is private; @@ -230,8 +230,10 @@ private Lock : Natural := 0; end record; + overriding procedure Adjust (Container : in out List); + overriding procedure Finalize (Container : in out List) renames Clear; use Ada.Streams; diff --git a/gcc/ada/a-cihase.ads b/gcc/ada/a-cihase.ads index aaf183b01c8..489e68fae69 100644 --- a/gcc/ada/a-cihase.ads +++ b/gcc/ada/a-cihase.ads @@ -2,12 +2,11 @@ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- --- A D A . C O N T A I N E R S . -- --- I N D E F I N I T E _ H A S H E D _ S E T S -- +-- ADA.CONTAINERS.INDEFINITE_HASHED_SETS -- -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -34,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Hash_Tables; -with Ada.Streams; -with Ada.Finalization; +private with Ada.Containers.Hash_Tables; +private with Ada.Streams; +private with Ada.Finalization; generic type Element_Type (<>) is private; @@ -417,8 +416,10 @@ private HT : HT_Types.Hash_Table_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set); use HT_Types; diff --git a/gcc/ada/a-ciorma.ads b/gcc/ada/a-ciorma.ads index 25033a9356d..3b483fcdd38 100644 --- a/gcc/ada/a-ciorma.ads +++ b/gcc/ada/a-ciorma.ads @@ -2,12 +2,11 @@ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- --- A D A . C O N T A I N E R S . -- --- I N D E F I N I T E _ O R D E R E D _ M A P S -- +-- ADA.CONTAINERS.INDEFINITE_ORDERED_MAPS -- -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -34,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Key_Type (<>) is private; @@ -203,8 +202,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Map); + overriding procedure Finalize (Container : in out Map) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-ciormu.ads b/gcc/ada/a-ciormu.ads index fec119b2850..e18e44fca90 100644 --- a/gcc/ada/a-ciormu.ads +++ b/gcc/ada/a-ciormu.ads @@ -2,12 +2,11 @@ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- --- A D A . C O N T A I N E R S . -- --- I N D E F I N I T E _ O R D E R E D _ M U L T I S E T S -- +-- ADA.CONTAINERS.INDEFINITE_ORDERED_MULTISETS -- -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -34,9 +33,11 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +-- Documentation of this unit is needed ??? + +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Element_Type (<>) is private; @@ -263,8 +264,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads index 67e383fb9d2..dae349b50f7 100644 --- a/gcc/ada/a-ciorse.ads +++ b/gcc/ada/a-ciorse.ads @@ -2,12 +2,11 @@ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- --- A D A . C O N T A I N E R S . -- --- I N D E F I N I T E _ O R D E R E D _ S E T S -- +-- ADA.CONTAINERS.INDEFINITE_ORDERED_SETS -- -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -34,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Element_Type (<>) is private; @@ -267,8 +266,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-cohase.ads b/gcc/ada/a-cohase.ads index e1600ff7373..4ed3734d28a 100644 --- a/gcc/ada/a-cohase.ads +++ b/gcc/ada/a-cohase.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -33,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Hash_Tables; -with Ada.Streams; -with Ada.Finalization; +private with Ada.Containers.Hash_Tables; +private with Ada.Streams; +private with Ada.Finalization; generic type Element_Type is private; @@ -416,8 +416,10 @@ private HT : HT_Types.Hash_Table_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set); use HT_Types; diff --git a/gcc/ada/a-coorma.ads b/gcc/ada/a-coorma.ads index 917c1c7b1e0..e620badb09d 100644 --- a/gcc/ada/a-coorma.ads +++ b/gcc/ada/a-coorma.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -33,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Key_Type is private; @@ -205,8 +205,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Map); + overriding procedure Finalize (Container : in out Map) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-coormu.ads b/gcc/ada/a-coormu.ads index bdb2150e014..05d71df4b0e 100644 --- a/gcc/ada/a-coormu.ads +++ b/gcc/ada/a-coormu.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -33,9 +33,11 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +-- Documentation is needed for this unit ??? + +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Element_Type is private; @@ -268,8 +270,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads index 2df6353fa3b..f0f62273c2c 100644 --- a/gcc/ada/a-coorse.ads +++ b/gcc/ada/a-coorse.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -33,9 +33,9 @@ -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -with Ada.Containers.Red_Black_Trees; -with Ada.Finalization; -with Ada.Streams; +private with Ada.Containers.Red_Black_Trees; +private with Ada.Finalization; +private with Ada.Streams; generic type Element_Type is private; @@ -256,8 +256,10 @@ private Tree : Tree_Types.Tree_Type; end record; + overriding procedure Adjust (Container : in out Set); + overriding procedure Finalize (Container : in out Set) renames Clear; use Red_Black_Trees; diff --git a/gcc/ada/a-direct.adb b/gcc/ada/a-direct.adb index ea7f02c008d..39a49c96090 100644 --- a/gcc/ada/a-direct.adb +++ b/gcc/ada/a-direct.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1197,10 +1197,15 @@ package body Ada.Directories is C_File_Name : constant String := Directory & ASCII.NUL; begin - -- First, the invalid case + -- First, the invalid cases if not Is_Directory (Directory) then - raise Name_Error; + raise Name_Error + with "unknown directory """ & Simple_Name (Directory) & '"'; + + elsif not Is_Readable_File (Directory) then + raise Use_Error + with "unreadable directory """ & Simple_Name (Directory) & '"'; end if; -- If needed, finalize Search @@ -1219,7 +1224,8 @@ package body Ada.Directories is exception when Error_In_Regexp => Free (Search.Value); - raise Name_Error; + raise Name_Error + with "invalid pattern """ & Pattern & '"'; end; -- Initialize some Search components diff --git a/gcc/ada/a-dynpri.adb b/gcc/ada/a-dynpri.adb index 982c17f99b7..5950cf82f90 100644 --- a/gcc/ada/a-dynpri.adb +++ b/gcc/ada/a-dynpri.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,21 +32,9 @@ ------------------------------------------------------------------------------ with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Set_Priority --- Wakeup --- Self - with System.Tasking; --- used for Task_Id - with System.Parameters; --- used for Single_Lock - with System.Soft_Links; --- use for Abort_Defer --- Abort_Undefer with Ada.Unchecked_Conversion; diff --git a/gcc/ada/a-elchha.adb b/gcc/ada/a-elchha.adb index 41ca1f57b41..fc4f9621b17 100644 --- a/gcc/ada/a-elchha.adb +++ b/gcc/ada/a-elchha.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2003-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -38,11 +38,7 @@ pragma Compiler_Unit; pragma Warnings (On); with System.Standard_Library; use System.Standard_Library; --- Used for Adafinal - with System.Soft_Links; --- Used for Task_Termination_Handler --- Task_Termination_NT procedure Ada.Exceptions.Last_Chance_Handler (Except : Exception_Occurrence) diff --git a/gcc/ada/a-except-2005.adb b/gcc/ada/a-except-2005.adb index 0994d201402..402a04cbe85 100644 --- a/gcc/ada/a-except-2005.adb +++ b/gcc/ada/a-except-2005.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,16 +31,14 @@ -- -- ------------------------------------------------------------------------------ --- This version is used for all Ada 2005 builds. It differs from a-except.ads --- only with respect to the addition of Wide_[Wide]Exception_Name functions. +-- This version of Ada.Exceptions fully supports both Ada 95 and Ada 2005. +-- It is used in all situations except for the build of the compiler and +-- other basic tools. For these latter builds, we use an Ada 95-only version. -- The reason for this splitting off of a separate version is that bootstrap -- compilers often will be used that do not support Ada 2005 features, and -- Ada.Exceptions is part of the compiler sources. --- The base version of this unit Ada.Exceptions omits the Wide version of --- Exception_Name and is used to build the compiler and other basic tools. - pragma Style_Checks (All_Checks); -- No subprogram ordering check, due to logical grouping diff --git a/gcc/ada/a-except-2005.ads b/gcc/ada/a-except-2005.ads index 62135090d99..6dae91ff467 100644 --- a/gcc/ada/a-except-2005.ads +++ b/gcc/ada/a-except-2005.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,18 +35,14 @@ -- -- ------------------------------------------------------------------------------ --- This version is used for all Ada 2005 builds. It differs from a-except.ads --- only with respect to the addition of Wide_[Wide]Exception_Name functions. --- The additional entities are marked with pragma Ada_05, so this extended --- unit is also perfectly suitable for use in Ada 95 or Ada 83 mode. +-- This version of Ada.Exceptions fully supports both Ada 95 and Ada 2005. +-- It is used in all situations except for the build of the compiler and +-- other basic tools. For these latter builds, we use an Ada 95-only version. -- The reason for this splitting off of a separate version is that bootstrap -- compilers often will be used that do not support Ada 2005 features, and -- Ada.Exceptions is part of the compiler sources. --- The base version of this unit Ada.Exceptions omits the Wide version of --- Exception_Name and is used to build the compiler and other basic tools. - pragma Polling (Off); -- We must turn polling off for this unit, because otherwise we get -- elaboration circularities with ourself. diff --git a/gcc/ada/a-except.adb b/gcc/ada/a-except.adb index 60f59952770..a07bf294203 100644 --- a/gcc/ada/a-except.adb +++ b/gcc/ada/a-except.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- diff --git a/gcc/ada/a-except.ads b/gcc/ada/a-except.ads index f01d1769029..a97ccb44032 100644 --- a/gcc/ada/a-except.ads +++ b/gcc/ada/a-except.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- diff --git a/gcc/ada/a-excpol-abort.adb b/gcc/ada/a-excpol-abort.adb index db04ec57e4d..dd5635bb859 100644 --- a/gcc/ada/a-excpol-abort.adb +++ b/gcc/ada/a-excpol-abort.adb @@ -7,7 +7,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -45,7 +45,6 @@ pragma Warnings (Off); -- It is safe in the context of the run-time to violate the rules! with System.Soft_Links; --- used for Check_Abort_Status pragma Warnings (On); diff --git a/gcc/ada/a-interr.ads b/gcc/ada/a-interr.ads index 8c9c7212b6d..8ccbd886a7d 100644 --- a/gcc/ada/a-interr.ads +++ b/gcc/ada/a-interr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -36,7 +36,6 @@ ------------------------------------------------------------------------------ with System.Interrupts; --- used for Ada_Interrupt_ID package Ada.Interrupts is diff --git a/gcc/ada/a-intnam-aix.ads b/gcc/ada/a-intnam-aix.ads index 12287066f61..cf01fc0a796 100644 --- a/gcc/ada/a-intnam-aix.ads +++ b/gcc/ada/a-intnam-aix.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -51,13 +51,12 @@ -- supported by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is -- Beware that the mapping of names to signals may be many-to-one. There - -- may be aliases. Also, for all signal names that are not supported on the - -- current system the value of the corresponding constant will be zero. + -- may be aliases. Also, for all signal names that are not supported on + -- the current system the value of the corresponding constant will be zero. SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup diff --git a/gcc/ada/a-intnam-darwin.ads b/gcc/ada/a-intnam-darwin.ads index 23d12f1de50..fbbb185835b 100644 --- a/gcc/ada/a-intnam-darwin.ads +++ b/gcc/ada/a-intnam-darwin.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -45,7 +45,6 @@ -- supported by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is @@ -53,100 +52,100 @@ package Ada.Interrupts.Names is -- may be aliases. Also, for all signal names that are not supported on the -- current system the value of the corresponding constant will be zero. - SIGHUP : constant Interrupt_ID := + SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup - SIGINT : constant Interrupt_ID := + SIGINT : constant Interrupt_ID := System.OS_Interface.SIGINT; -- interrupt (rubout) - SIGQUIT : constant Interrupt_ID := + SIGQUIT : constant Interrupt_ID := System.OS_Interface.SIGQUIT; -- quit (ASCD FS) - SIGILL : constant Interrupt_ID := + SIGILL : constant Interrupt_ID := System.OS_Interface.SIGILL; -- illegal instruction (not reset) - SIGTRAP : constant Interrupt_ID := + SIGTRAP : constant Interrupt_ID := System.OS_Interface.SIGTRAP; -- trace trap (not reset) - SIGIOT : constant Interrupt_ID := + SIGIOT : constant Interrupt_ID := System.OS_Interface.SIGIOT; -- IOT instruction - SIGABRT : constant Interrupt_ID := -- used by abort, + SIGABRT : constant Interrupt_ID := -- used by abort, System.OS_Interface.SIGABRT; -- replace SIGIOT in the future - SIGEMT : constant Interrupt_ID := + SIGEMT : constant Interrupt_ID := System.OS_Interface.SIGEMT; -- EMT instruction - SIGFPE : constant Interrupt_ID := + SIGFPE : constant Interrupt_ID := System.OS_Interface.SIGFPE; -- floating point exception - SIGKILL : constant Interrupt_ID := + SIGKILL : constant Interrupt_ID := System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) - SIGBUS : constant Interrupt_ID := + SIGBUS : constant Interrupt_ID := System.OS_Interface.SIGBUS; -- bus error - SIGSEGV : constant Interrupt_ID := + SIGSEGV : constant Interrupt_ID := System.OS_Interface.SIGSEGV; -- segmentation violation - SIGSYS : constant Interrupt_ID := + SIGSYS : constant Interrupt_ID := System.OS_Interface.SIGSYS; -- bad argument to system call - SIGPIPE : constant Interrupt_ID := -- write on a pipe with + SIGPIPE : constant Interrupt_ID := -- write on a pipe with System.OS_Interface.SIGPIPE; -- no one to read it - SIGALRM : constant Interrupt_ID := + SIGALRM : constant Interrupt_ID := System.OS_Interface.SIGALRM; -- alarm clock - SIGTERM : constant Interrupt_ID := + SIGTERM : constant Interrupt_ID := System.OS_Interface.SIGTERM; -- software termination signal from kill - SIGURG : constant Interrupt_ID := + SIGURG : constant Interrupt_ID := System.OS_Interface.SIGURG; -- urgent condition on IO channel - SIGSTOP : constant Interrupt_ID := + SIGSTOP : constant Interrupt_ID := System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) - SIGTSTP : constant Interrupt_ID := + SIGTSTP : constant Interrupt_ID := System.OS_Interface.SIGTSTP; -- user stop requested from tty - SIGCONT : constant Interrupt_ID := + SIGCONT : constant Interrupt_ID := System.OS_Interface.SIGCONT; -- stopped process has been continued - SIGCHLD : constant Interrupt_ID := + SIGCHLD : constant Interrupt_ID := System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD - SIGTTIN : constant Interrupt_ID := + SIGTTIN : constant Interrupt_ID := System.OS_Interface.SIGTTIN; -- background tty read attempted - SIGTTOU : constant Interrupt_ID := + SIGTTOU : constant Interrupt_ID := System.OS_Interface.SIGTTOU; -- background tty write attempted - SIGIO : constant Interrupt_ID := -- input/output possible, + SIGIO : constant Interrupt_ID := -- input/output possible, System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) - SIGXCPU : constant Interrupt_ID := + SIGXCPU : constant Interrupt_ID := System.OS_Interface.SIGXCPU; -- CPU time limit exceeded - SIGXFSZ : constant Interrupt_ID := + SIGXFSZ : constant Interrupt_ID := System.OS_Interface.SIGXFSZ; -- filesize limit exceeded SIGVTALRM : constant Interrupt_ID := System.OS_Interface.SIGVTALRM; -- virtual timer expired - SIGPROF : constant Interrupt_ID := + SIGPROF : constant Interrupt_ID := System.OS_Interface.SIGPROF; -- profiling timer expired - SIGWINCH : constant Interrupt_ID := + SIGWINCH : constant Interrupt_ID := System.OS_Interface.SIGWINCH; -- window size change - SIGINFO : constant Interrupt_ID := + SIGINFO : constant Interrupt_ID := System.OS_Interface.SIGINFO; -- information request - SIGUSR1 : constant Interrupt_ID := + SIGUSR1 : constant Interrupt_ID := System.OS_Interface.SIGUSR1; -- user defined signal 1 - SIGUSR2 : constant Interrupt_ID := + SIGUSR2 : constant Interrupt_ID := System.OS_Interface.SIGUSR2; -- user defined signal 2 end Ada.Interrupts.Names; diff --git a/gcc/ada/a-intnam-freebsd.ads b/gcc/ada/a-intnam-freebsd.ads index 329b0f6508f..fdae2170510 100644 --- a/gcc/ada/a-intnam-freebsd.ads +++ b/gcc/ada/a-intnam-freebsd.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,10 +34,13 @@ -- This is the FreeBSD THREADS version of this package with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is + -- Beware that the mapping of names to signals may be many-to-one. There + -- may be aliases. Also, for all signal names that are not supported on + -- the current system the value of the corresponding constant will be zero. + SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup @@ -128,9 +131,4 @@ package Ada.Interrupts.Names is SIGUSR2 : constant Interrupt_ID := System.OS_Interface.SIGUSR2; -- user defined signal 2 - -- Beware that the mapping of names to signals may be - -- many-to-one. There may be aliases. Also, for all - -- signal names that are not supported on the current system - -- the value of the corresponding constant will be zero. - end Ada.Interrupts.Names; diff --git a/gcc/ada/a-intnam-hpux.ads b/gcc/ada/a-intnam-hpux.ads index 51eee895a9e..2f7b91963f8 100644 --- a/gcc/ada/a-intnam-hpux.ads +++ b/gcc/ada/a-intnam-hpux.ads @@ -6,8 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -47,14 +46,12 @@ -- supported by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is - -- Beware that the mapping of names to signals may be - -- many-to-one. There may be aliases. Also, for all - -- signal names that are not supported on the current system - -- the value of the corresponding constant will be zero. + -- Beware that the mapping of names to signals may be many-to-one. There + -- may be aliases. Also, for all signal names that are not supported on + -- the current system the value of the corresponding constant will be zero. SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup diff --git a/gcc/ada/a-intnam-irix.ads b/gcc/ada/a-intnam-irix.ads index 43aed478823..0e7c55919f8 100644 --- a/gcc/ada/a-intnam-irix.ads +++ b/gcc/ada/a-intnam-irix.ads @@ -6,8 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU Library General Public License as published by the -- @@ -53,14 +52,12 @@ -- supported by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is - -- Beware that the mapping of names to signals may be - -- many-to-one. There may be aliases. Also, for all - -- signal names that are not supported on the current system - -- the value of the corresponding constant will be zero. + -- Beware that the mapping of names to signals may be many-to-one. There + -- may be aliases. Also, for all signal names that are not supported on + -- the current system the value of the corresponding constant will be zero. SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup diff --git a/gcc/ada/a-intnam-linux.ads b/gcc/ada/a-intnam-linux.ads index 70fb471b084..5425eb32ae3 100644 --- a/gcc/ada/a-intnam-linux.ads +++ b/gcc/ada/a-intnam-linux.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -51,7 +51,6 @@ -- supported by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is diff --git a/gcc/ada/a-intnam-lynxos.ads b/gcc/ada/a-intnam-lynxos.ads index 850eb2af033..0f4196261c7 100644 --- a/gcc/ada/a-intnam-lynxos.ads +++ b/gcc/ada/a-intnam-lynxos.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,7 +43,6 @@ -- SIGINT: made available for Ada handler with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is diff --git a/gcc/ada/a-intnam-mingw.ads b/gcc/ada/a-intnam-mingw.ads index a8c5e4ee11a..d7a2de73f3a 100644 --- a/gcc/ada/a-intnam-mingw.ads +++ b/gcc/ada/a-intnam-mingw.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,7 +37,6 @@ -- by the local system. with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is @@ -45,22 +44,22 @@ package Ada.Interrupts.Names is -- may be aliases. Also, for all signal names that are not supported on the -- current system the value of the corresponding constant will be zero. - SIGINT : constant Interrupt_ID := - System.OS_Interface.SIGINT; -- interrupt (rubout) + SIGINT : constant Interrupt_ID := -- interrupt (rubout) + System.OS_Interface.SIGINT; - SIGILL : constant Interrupt_ID := - System.OS_Interface.SIGILL; -- illegal instruction (not reset) + SIGILL : constant Interrupt_ID := -- illegal instruction (not reset) + System.OS_Interface.SIGILL; - SIGABRT : constant Interrupt_ID := -- used by abort, - System.OS_Interface.SIGABRT; -- replace SIGIOT in the future + SIGABRT : constant Interrupt_ID := -- used by abort (use SIGIOT in future) + System.OS_Interface.SIGABRT; - SIGFPE : constant Interrupt_ID := - System.OS_Interface.SIGFPE; -- floating point exception + SIGFPE : constant Interrupt_ID := -- floating point exception + System.OS_Interface.SIGFPE; - SIGSEGV : constant Interrupt_ID := - System.OS_Interface.SIGSEGV; -- segmentation violation + SIGSEGV : constant Interrupt_ID := -- segmentation violation + System.OS_Interface.SIGSEGV; - SIGTERM : constant Interrupt_ID := - System.OS_Interface.SIGTERM; -- software termination signal from kill + SIGTERM : constant Interrupt_ID := -- software termination signal from kill + System.OS_Interface.SIGTERM; end Ada.Interrupts.Names; diff --git a/gcc/ada/a-intnam-solaris.ads b/gcc/ada/a-intnam-solaris.ads index 6842d68f900..f14f7624f27 100644 --- a/gcc/ada/a-intnam-solaris.ads +++ b/gcc/ada/a-intnam-solaris.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -48,7 +48,6 @@ -- SIGINT: made available for Ada handlers with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is diff --git a/gcc/ada/a-intnam-tru64.ads b/gcc/ada/a-intnam-tru64.ads index 8b6a838c101..ec7c9078f5d 100644 --- a/gcc/ada/a-intnam-tru64.ads +++ b/gcc/ada/a-intnam-tru64.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,7 +43,6 @@ -- SIGINT: made available for Ada handler with System.OS_Interface; --- used for names of interrupts package Ada.Interrupts.Names is diff --git a/gcc/ada/a-intnam-vms.ads b/gcc/ada/a-intnam-vms.ads index 3b745d17ccb..8cfe0ba63ae 100644 --- a/gcc/ada/a-intnam-vms.ads +++ b/gcc/ada/a-intnam-vms.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,6 +37,7 @@ -- supported by the local system. with System.OS_Interface; + package Ada.Interrupts.Names is package OS renames System.OS_Interface; diff --git a/gcc/ada/a-retide.adb b/gcc/ada/a-retide.adb index f6ffe7e3d71..42d2d173d53 100644 --- a/gcc/ada/a-retide.adb +++ b/gcc/ada/a-retide.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,15 +32,9 @@ ------------------------------------------------------------------------------ with Ada.Exceptions; --- Used for Raise_Exception with System.Tasking; --- Used for Task_Id --- Initialize - with System.Task_Primitives.Operations; --- Used for Timed_Delay --- Self package body Ada.Real_Time.Delays is diff --git a/gcc/ada/a-rttiev.adb b/gcc/ada/a-rttiev.adb index f8cd699497a..7031dfbc7c3 100644 --- a/gcc/ada/a-rttiev.adb +++ b/gcc/ada/a-rttiev.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2005-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 2005-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,7 +34,6 @@ with System.Task_Primitives.Operations; with System.Tasking.Utilities; with System.Soft_Links; --- used for Abort_Defer/Undefer with Ada.Containers.Doubly_Linked_Lists; pragma Elaborate_All (Ada.Containers.Doubly_Linked_Lists); @@ -46,7 +45,6 @@ pragma Elaborate_All (Ada.Containers.Doubly_Linked_Lists); package body Ada.Real_Time.Timing_Events is use System.Task_Primitives.Operations; - -- for Write_Lock and Unlock package SSL renames System.Soft_Links; diff --git a/gcc/ada/a-suteio.adb b/gcc/ada/a-suteio.adb index 98034e2b110..ef01398a815 100644 --- a/gcc/ada/a-suteio.adb +++ b/gcc/ada/a-suteio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -51,7 +51,9 @@ package body Ada.Strings.Unbounded.Text_IO is Str1 := new String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (Buffer, Last); - Str2 := new String'(Str1.all & Buffer (1 .. Last)); + Str2 := new String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; @@ -73,7 +75,9 @@ package body Ada.Strings.Unbounded.Text_IO is Str1 := new String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (File, Buffer, Last); - Str2 := new String'(Str1.all & Buffer (1 .. Last)); + Str2 := new String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; diff --git a/gcc/ada/a-swuwti.adb b/gcc/ada/a-swuwti.adb index 1e6bb2e7eab..bd06eb18c39 100644 --- a/gcc/ada/a-swuwti.adb +++ b/gcc/ada/a-swuwti.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -51,7 +51,9 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is Str1 := new Wide_String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (Buffer, Last); - Str2 := new Wide_String'(Str1.all & Buffer (1 .. Last)); + Str2 := new Wide_String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; @@ -75,7 +77,9 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is Str1 := new Wide_String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (File, Buffer, Last); - Str2 := new Wide_String'(Str1.all & Buffer (1 .. Last)); + Str2 := new Wide_String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; diff --git a/gcc/ada/a-sytaco.adb b/gcc/ada/a-sytaco.adb index 3d0aaaa8c3b..cf4d115cc14 100644 --- a/gcc/ada/a-sytaco.adb +++ b/gcc/ada/a-sytaco.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,20 +31,10 @@ -- -- ------------------------------------------------------------------------------ -with System.Tasking; --- Used for Detect_Blocking --- Self - with Ada.Exceptions; --- Used for Raise_Exception +with System.Tasking; with System.Task_Primitives.Operations; --- Used for Initialize --- Finalize --- Current_State --- Set_False --- Set_True --- Suspend_Until_True package body Ada.Synchronous_Task_Control is diff --git a/gcc/ada/a-sytaco.ads b/gcc/ada/a-sytaco.ads index 96480cf26e8..db102f679b3 100644 --- a/gcc/ada/a-sytaco.ads +++ b/gcc/ada/a-sytaco.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -36,10 +36,8 @@ ------------------------------------------------------------------------------ with System.Task_Primitives; --- Used for Suspension_Object with Ada.Finalization; --- Used for Limited_Controlled package Ada.Synchronous_Task_Control is pragma Preelaborate_05; diff --git a/gcc/ada/a-szuzti.adb b/gcc/ada/a-szuzti.adb index 850ae78cca2..7a8a31373fe 100644 --- a/gcc/ada/a-szuzti.adb +++ b/gcc/ada/a-szuzti.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -51,7 +51,9 @@ package body Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO is Str1 := new Wide_Wide_String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (Buffer, Last); - Str2 := new Wide_Wide_String'(Str1.all & Buffer (1 .. Last)); + Str2 := new Wide_Wide_String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; @@ -76,7 +78,9 @@ package body Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO is while Last = Buffer'Last loop Get_Line (File, Buffer, Last); - Str2 := new Wide_Wide_String'(Str1.all & Buffer (1 .. Last)); + Str2 := new Wide_Wide_String (1 .. Str1'Last + Last); + Str2 (Str1'Range) := Str1.all; + Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last); Free (Str1); Str1 := Str2; end loop; diff --git a/gcc/ada/a-tasatt.adb b/gcc/ada/a-tasatt.adb index cc6977fd8c0..0140df956d4 100644 --- a/gcc/ada/a-tasatt.adb +++ b/gcc/ada/a-tasatt.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -222,39 +222,13 @@ -- instantiated from within a local context. with System.Error_Reporting; --- Used for Shutdown; - with System.Storage_Elements; --- Used for Integer_Address - with System.Task_Primitives.Operations; --- Used for Write_Lock --- Unlock --- Lock/Unlock_RTS - with System.Tasking; --- Used for Access_Address --- Task_Id --- Direct_Index_Vector --- Direct_Index - with System.Tasking.Initialization; --- Used for Defer_Abort --- Undefer_Abort --- Initialize_Attributes_Link --- Finalize_Attributes_Link - with System.Tasking.Task_Attributes; --- Used for Access_Node --- Access_Dummy_Wrapper --- Deallocator --- Instance --- Node --- Access_Instance with Ada.Exceptions; --- Used for Raise_Exception - with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; diff --git a/gcc/ada/a-taside.adb b/gcc/ada/a-taside.adb index 005d9619387..e9431d16499 100644 --- a/gcc/ada/a-taside.adb +++ b/gcc/ada/a-taside.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,7 +43,6 @@ pragma Warnings (Off); -- It is safe in the context of the run-time to violate the rules! with System.Tasking.Utilities; --- Used for Abort_Tasks pragma Warnings (On); diff --git a/gcc/ada/a-taster.adb b/gcc/ada/a-taster.adb index aa06c95cae8..1a1e6492575 100644 --- a/gcc/ada/a-taster.adb +++ b/gcc/ada/a-taster.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2005-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2005-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,21 +32,9 @@ ------------------------------------------------------------------------------ with System.Tasking; --- used for Task_Id - with System.Task_Primitives.Operations; --- used for Self --- Write_Lock --- Unlock --- Lock_RTS --- Unlock_RTS - with System.Parameters; --- used for Single_Lock - with System.Soft_Links; --- use for Abort_Defer --- Abort_Undefer with Ada.Unchecked_Conversion; diff --git a/gcc/ada/a-teioed.adb b/gcc/ada/a-teioed.adb index a2887527f14..a5c2b662e36 100644 --- a/gcc/ada/a-teioed.adb +++ b/gcc/ada/a-teioed.adb @@ -417,7 +417,7 @@ package body Ada.Text_IO.Editing is Answer (J) := Separator_Character; elsif Answer (J) = 'b' then - Answer (J) := '*'; + Answer (J) := Fill_Character; end if; end loop; @@ -426,7 +426,7 @@ package body Ada.Text_IO.Editing is end if; for J in Pic.Start_Float .. Position loop - Answer (J) := '*'; + Answer (J) := Fill_Character; end loop; else diff --git a/gcc/ada/a-teioed.ads b/gcc/ada/a-teioed.ads index b2c34121ada..9d520b631e0 100644 --- a/gcc/ada/a-teioed.ads +++ b/gcc/ada/a-teioed.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -55,7 +55,7 @@ package Ada.Text_IO.Editing is Picture_Error : exception; Default_Currency : constant String := "$"; - Default_Fill : constant Character := ' '; + Default_Fill : constant Character := '*'; Default_Separator : constant Character := ','; Default_Radix_Mark : constant Character := '.'; diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb index 3711ab05b38..050e71d500c 100644 --- a/gcc/ada/a-textio.adb +++ b/gcc/ada/a-textio.adb @@ -1037,7 +1037,7 @@ package body Ada.Text_IO is Item := ASCII.NUL; -- If we are before an upper half character just return it (this can - -- happen if there are two calls to Look_Ahead in a row. + -- happen if there are two calls to Look_Ahead in a row). elsif File.Before_Upper_Half_Character then End_Of_Line := False; @@ -2253,7 +2253,7 @@ begin Standard_In.Is_Text_File := True; Standard_In.Access_Method := 'T'; Standard_In.Self := Standard_In; - Standard_In.WC_Method := Default_WCEM; + Standard_In.WC_Method := Default_WCEM; Standard_Out.Stream := stdout; Standard_Out.Name := Out_Name'Access; diff --git a/gcc/ada/a-tigeau.ads b/gcc/ada/a-tigeau.ads index d0443739142..16299b03b7f 100644 --- a/gcc/ada/a-tigeau.ads +++ b/gcc/ada/a-tigeau.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -178,7 +178,7 @@ private package Ada.Text_IO.Generic_Aux is procedure String_Skip (Str : String; Ptr : out Integer); -- Used in the Get from string procedures to skip leading blanks in the -- string. Ptr is set to the index of the first non-blank. If the string - -- is all blanks, then the excption End_Error is raised, Note that blank + -- is all blanks, then the exception End_Error is raised, Note that blank -- is defined as a space or horizontal tab (RM A.10.6(5)). procedure Ungetc (ch : Integer; File : File_Type); diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb index 64e1988e83f..86a37b6fbe8 100644 --- a/gcc/ada/a-witeio.adb +++ b/gcc/ada/a-witeio.adb @@ -180,6 +180,8 @@ package body Ada.Wide_Text_IO is Amethod => 'W', Creat => True, Text => True); + + File.Self := File; Set_WCEM (File); end Create; @@ -194,7 +196,7 @@ package body Ada.Wide_Text_IO is function Current_Error return File_Access is begin - return Current_Err'Access; + return Current_Err.Self'Access; end Current_Error; ------------------- @@ -208,7 +210,7 @@ package body Ada.Wide_Text_IO is function Current_Input return File_Access is begin - return Current_In'Access; + return Current_In.Self'Access; end Current_Input; -------------------- @@ -222,7 +224,7 @@ package body Ada.Wide_Text_IO is function Current_Output return File_Access is begin - return Current_Out'Access; + return Current_Out.Self'Access; end Current_Output; ------------ @@ -754,6 +756,7 @@ package body Ada.Wide_Text_IO is -- Start of processing for Get_Wide_Char begin + FIO.Check_Read_Status (AP (File)); return WC_In (C, File.WC_Method); end Get_Wide_Char; @@ -788,6 +791,7 @@ package body Ada.Wide_Text_IO is -- Start of processing for Get_Wide_Char_Immed begin + FIO.Check_Read_Status (AP (File)); return WC_In (C, File.WC_Method); end Get_Wide_Char_Immed; @@ -1089,6 +1093,8 @@ package body Ada.Wide_Text_IO is Amethod => 'W', Creat => False, Text => True); + + File.Self := File; Set_WCEM (File); end Open; @@ -1151,6 +1157,7 @@ package body Ada.Wide_Text_IO is -- Start of processing for Put begin + FIO.Check_Write_Status (AP (File)); WC_Out (Item, File.WC_Method); File.Col := File.Col + 1; end Put; @@ -1869,18 +1876,20 @@ begin Standard_Err.Is_System_File := True; Standard_Err.Is_Text_File := True; Standard_Err.Access_Method := 'T'; + Standard_Err.Self := Standard_Err; Standard_Err.WC_Method := Default_WCEM; - Standard_In.Stream := stdin; - Standard_In.Name := In_Name'Access; - Standard_In.Form := Null_Str'Unrestricted_Access; - Standard_In.Mode := FCB.In_File; - Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0; - Standard_In.Is_Temporary_File := False; - Standard_In.Is_System_File := True; - Standard_In.Is_Text_File := True; - Standard_In.Access_Method := 'T'; - Standard_In.WC_Method := Default_WCEM; + Standard_In.Stream := stdin; + Standard_In.Name := In_Name'Access; + Standard_In.Form := Null_Str'Unrestricted_Access; + Standard_In.Mode := FCB.In_File; + Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0; + Standard_In.Is_Temporary_File := False; + Standard_In.Is_System_File := True; + Standard_In.Is_Text_File := True; + Standard_In.Access_Method := 'T'; + Standard_In.Self := Standard_In; + Standard_In.WC_Method := Default_WCEM; Standard_Out.Stream := stdout; Standard_Out.Name := Out_Name'Access; @@ -1891,6 +1900,7 @@ begin Standard_Out.Is_System_File := True; Standard_Out.Is_Text_File := True; Standard_Out.Access_Method := 'T'; + Standard_Out.Self := Standard_Out; Standard_Out.WC_Method := Default_WCEM; FIO.Chain_File (AP (Standard_In)); diff --git a/gcc/ada/a-witeio.ads b/gcc/ada/a-witeio.ads index 3d676a9acd6..b7d06ea8732 100644 --- a/gcc/ada/a-witeio.ads +++ b/gcc/ada/a-witeio.ads @@ -350,6 +350,12 @@ private Line_Length : Count := 0; Page_Length : Count := 0; + Self : aliased File_Type; + -- Set to point to the containing Text_AFCB block. This is used to + -- implement the Current_{Error,Input,Ouput} functions which return + -- a File_Access, the file access value returned is a pointer to + -- the Self field of the corresponding file. + Before_LM : Boolean := False; -- This flag is used to deal with the anomolies introduced by the -- peculiar definition of End_Of_File and End_Of_Page in Ada. These diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb index 74a60f92093..296202256e7 100644 --- a/gcc/ada/a-ztexio.adb +++ b/gcc/ada/a-ztexio.adb @@ -180,6 +180,8 @@ package body Ada.Wide_Wide_Text_IO is Amethod => 'W', Creat => True, Text => True); + + File.Self := File; Set_WCEM (File); end Create; @@ -194,7 +196,7 @@ package body Ada.Wide_Wide_Text_IO is function Current_Error return File_Access is begin - return Current_Err'Access; + return Current_Err.Self'Access; end Current_Error; ------------------- @@ -208,7 +210,7 @@ package body Ada.Wide_Wide_Text_IO is function Current_Input return File_Access is begin - return Current_In'Access; + return Current_In.Self'Access; end Current_Input; -------------------- @@ -222,7 +224,7 @@ package body Ada.Wide_Wide_Text_IO is function Current_Output return File_Access is begin - return Current_Out'Access; + return Current_Out.Self'Access; end Current_Output; ------------ @@ -754,6 +756,7 @@ package body Ada.Wide_Wide_Text_IO is -- Start of processing for Get_Wide_Wide_Char begin + FIO.Check_Read_Status (AP (File)); return Wide_Wide_Character'Val (WC_In (C, File.WC_Method)); end Get_Wide_Wide_Char; @@ -788,6 +791,7 @@ package body Ada.Wide_Wide_Text_IO is -- Start of processing for Get_Wide_Wide_Char_Immed begin + FIO.Check_Read_Status (AP (File)); return Wide_Wide_Character'Val (WC_In (C, File.WC_Method)); end Get_Wide_Wide_Char_Immed; @@ -1089,6 +1093,8 @@ package body Ada.Wide_Wide_Text_IO is Amethod => 'W', Creat => False, Text => True); + + File.Self := File; Set_WCEM (File); end Open; @@ -1151,6 +1157,7 @@ package body Ada.Wide_Wide_Text_IO is -- Start of processing for Put begin + FIO.Check_Write_Status (AP (File)); WC_Out (Wide_Wide_Character'Pos (Item), File.WC_Method); File.Col := File.Col + 1; end Put; @@ -1869,18 +1876,20 @@ begin Standard_Err.Is_System_File := True; Standard_Err.Is_Text_File := True; Standard_Err.Access_Method := 'T'; + Standard_Err.Self := Standard_Err; Standard_Err.WC_Method := Default_WCEM; - Standard_In.Stream := stdin; - Standard_In.Name := In_Name'Access; - Standard_In.Form := Null_Str'Unrestricted_Access; - Standard_In.Mode := FCB.In_File; - Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0; - Standard_In.Is_Temporary_File := False; - Standard_In.Is_System_File := True; - Standard_In.Is_Text_File := True; - Standard_In.Access_Method := 'T'; - Standard_In.WC_Method := Default_WCEM; + Standard_In.Stream := stdin; + Standard_In.Name := In_Name'Access; + Standard_In.Form := Null_Str'Unrestricted_Access; + Standard_In.Mode := FCB.In_File; + Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0; + Standard_In.Is_Temporary_File := False; + Standard_In.Is_System_File := True; + Standard_In.Is_Text_File := True; + Standard_In.Access_Method := 'T'; + Standard_In.Self := Standard_In; + Standard_In.WC_Method := Default_WCEM; Standard_Out.Stream := stdout; Standard_Out.Name := Out_Name'Access; @@ -1891,6 +1900,7 @@ begin Standard_Out.Is_System_File := True; Standard_Out.Is_Text_File := True; Standard_Out.Access_Method := 'T'; + Standard_Out.Self := Standard_Out; Standard_Out.WC_Method := Default_WCEM; FIO.Chain_File (AP (Standard_In)); diff --git a/gcc/ada/a-ztexio.ads b/gcc/ada/a-ztexio.ads index 3010e517203..dd872dcfb1c 100644 --- a/gcc/ada/a-ztexio.ads +++ b/gcc/ada/a-ztexio.ads @@ -350,6 +350,12 @@ private Line_Length : Count := 0; Page_Length : Count := 0; + Self : aliased File_Type; + -- Set to point to the containing Text_AFCB block. This is used to + -- implement the Current_{Error,Input,Ouput} functions which return + -- a File_Access, the file access value returned is a pointer to + -- the Self field of the corresponding file. + Before_LM : Boolean := False; -- This flag is used to deal with the anomolies introduced by the -- peculiar definition of End_Of_File and End_Of_Page in Ada. These diff --git a/gcc/ada/a-ztinau.ads b/gcc/ada/a-ztinau.ads index b37a9d1a7a8..71454eb3b90 100644 --- a/gcc/ada/a-ztinau.ads +++ b/gcc/ada/a-ztinau.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,10 +32,10 @@ ------------------------------------------------------------------------------ -- This package contains the routines for Ada.Wide_Wide_Text_IO.Integer_IO --- that are shared among separate instantiations of this package. The --- routines in this package are identical semantically to those in Integer_IO --- itself, except that the generic parameter Num has been replaced by Integer --- or Long_Long_Integer, and the default parameters have been removed because +-- that are shared among separate instantiations of this package. The routines +-- in this package are identical semantically to those in Integer_IO itself, +-- except that the generic parameter Num has been replaced by Integer or +-- Long_Long_Integer, and the default parameters have been removed because -- they are supplied explicitly by the calls from within the generic template. private package Ada.Wide_Wide_Text_IO.Integer_Aux is diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 3bc20eb672e..b65a1c7176c 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -643,9 +643,9 @@ __gnat_get_debuggable_suffix_ptr (int *len, const char **value) /* Returns the OS filename and corresponding encoding. */ void -__gnat_os_filename (char *filename, char *w_filename, +__gnat_os_filename (char *filename, char *w_filename ATTRIBUTE_UNUSED, char *os_name, int *o_length, - char *encoding, int *e_length) + char *encoding ATTRIBUTE_UNUSED, int *e_length) { #if defined (_WIN32) && ! defined (__vxworks) && ! defined (CROSS_DIRECTORY_STRUCTURE) WS2SU (os_name, (TCHAR *)w_filename, o_length); @@ -660,7 +660,7 @@ __gnat_os_filename (char *filename, char *w_filename, } FILE * -__gnat_fopen (char *path, char *mode, int encoding) +__gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED) { #if defined (_WIN32) && ! defined (__vxworks) && ! defined (CROSS_DIRECTORY_STRUCTURE) TCHAR wpath[GNAT_MAX_PATH_LEN]; @@ -682,7 +682,7 @@ __gnat_fopen (char *path, char *mode, int encoding) } FILE * -__gnat_freopen (char *path, char *mode, FILE *stream, int encoding) +__gnat_freopen (char *path, char *mode, FILE *stream, int encoding ATTRIBUTE_UNUSED) { #if defined (_WIN32) && ! defined (__vxworks) && ! defined (CROSS_DIRECTORY_STRUCTURE) TCHAR wpath[GNAT_MAX_PATH_LEN]; @@ -3033,6 +3033,10 @@ void GetTimeAsFileTime(LPFILETIME pTime) #if defined (linux) /* pthread affinity support */ +int __gnat_pthread_setaffinity_np (pthread_t th, + size_t cpusetsize, + const void *cpuset); + #ifdef CPU_SETSIZE #include <pthread.h> int @@ -3044,9 +3048,9 @@ __gnat_pthread_setaffinity_np (pthread_t th, } #else int -__gnat_pthread_setaffinity_np (pthread_t th, - size_t cpusetsize, - const void *cpuset) +__gnat_pthread_setaffinity_np (pthread_t th ATTRIBUTE_UNUSED, + size_t cpusetsize ATTRIBUTE_UNUSED, + const void *cpuset ATTRIBUTE_UNUSED) { return 0; } diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb index 8466ddd91d8..96624d6a835 100644 --- a/gcc/ada/ali.adb +++ b/gcc/ada/ali.adb @@ -818,6 +818,7 @@ package body ALI is No_Object => False, Normalize_Scalars => False, Ofile_Full_Name => Full_Object_File_Name, + Optimize_Alignment_Setting => 'O', Queuing_Policy => ' ', Restrictions => No_Restrictions, SAL_Interface => False, @@ -1040,6 +1041,11 @@ package body ALI is Fatal_Error_Ignore; end if; + -- Processing for Ox + + elsif C = 'O' then + ALIs.Table (Id).Optimize_Alignment_Setting := Getc; + -- Processing for Qx elsif C = 'Q' then diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads index 94715b31196..90c8e0d50c9 100644 --- a/gcc/ada/ali.ads +++ b/gcc/ada/ali.ads @@ -122,82 +122,83 @@ package ALI is -- Id of last Sdep table entry for this file Main_Program : Main_Program_Type; - -- Indicator of whether first unit can be used as main program. - -- Not set if 'M' appears in Ignore_Lines. + -- Indicator of whether first unit can be used as main program. Not set + -- if 'M' appears in Ignore_Lines. Main_Priority : Int; - -- Indicates priority value if Main_Program field indicates that - -- this can be a main program. A value of -1 (No_Main_Priority) - -- indicates that no parameter was found, or no M line was present. - -- Not set if 'M' appears in Ignore_Lines. + -- Indicates priority value if Main_Program field indicates that this + -- can be a main program. A value of -1 (No_Main_Priority) indicates + -- that no parameter was found, or no M line was present. Not set if + -- 'M' appears in Ignore_Lines. Time_Slice_Value : Int; -- Indicates value of time slice parameter from T=xxx on main program - -- line. A value of -1 indicates that no T=xxx parameter was found, - -- or no M line was present. - -- Not set if 'M' appears in Ignore_Lines. + -- line. A value of -1 indicates that no T=xxx parameter was found, or + -- no M line was present. Not set if 'M' appears in Ignore_Lines. WC_Encoding : Character; -- Wide character encoding if main procedure. Otherwise not relevant. -- Not set if 'M' appears in Ignore_Lines. Locking_Policy : Character; - -- Indicates locking policy for units in this file. Space means - -- tasking was not used, or that no Locking_Policy pragma was - -- present or that this is a language defined unit. Otherwise set - -- to first character (upper case) of policy name. - -- Not set if 'P' appears in Ignore_Lines. + -- Indicates locking policy for units in this file. Space means tasking + -- was not used, or that no Locking_Policy pragma was present or that + -- this is a language defined unit. Otherwise set to first character + -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines. Queuing_Policy : Character; - -- Indicates queuing policy for units in this file. Space means - -- tasking was not used, or that no Queuing_Policy pragma was - -- present or that this is a language defined unit. Otherwise set - -- to first character (upper case) of policy name. - -- Not set if 'P' appears in Ignore_Lines. + -- Indicates queuing policy for units in this file. Space means tasking + -- was not used, or that no Queuing_Policy pragma was present or that + -- this is a language defined unit. Otherwise set to first character + -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines. Task_Dispatching_Policy : Character; - -- Indicates task dispatching policy for units in this file. Space - -- means tasking was not used, or that no Task_Dispatching_Policy - -- pragma was present or that this is a language defined unit. - -- Otherwise set to first character (upper case) of policy name. - -- Not set if 'P' appears in Ignore_Lines. + -- Indicates task dispatching policy for units in this file. Space means + -- tasking was not used, or that no Task_Dispatching_Policy pragma was + -- present or that this is a language defined unit. Otherwise set to + -- first character (upper case) of policy name. Not set if 'P' appears + -- in Ignore_Lines. Compile_Errors : Boolean; - -- Set to True if compile errors for unit. Note that No_Object - -- will always be set as well in this case. - -- Not set if 'P' appears in Ignore_Lines. + -- Set to True if compile errors for unit. Note that No_Object will + -- always be set as well in this case. Not set if 'P' appears in + -- Ignore_Lines. Float_Format : Character; - -- Set to float format (set to I if no float-format given). - -- Not set if 'P' appears in Ignore_Lines. + -- Set to float format (set to I if no float-format given). Not set if + -- 'P' appears in Ignore_Lines. No_Object : Boolean; - -- Set to True if no object file generated. - -- Not set if 'P' appears in Ignore_Lines. + -- Set to True if no object file generated. Not set if 'P' appears in + -- Ignore_Lines. Normalize_Scalars : Boolean; - -- Set to True if file was compiled with Normalize_Scalars. - -- Not set if 'P' appears in Ignore_Lines. + -- Set to True if file was compiled with Normalize_Scalars. Not set if + -- 'P' appears in Ignore_Lines. + + Optimize_Alignment_Setting : Character; + -- Optimize_Alignment setting. Set to S/T if OS/OT parameters present, + -- otherwise set to 'O' (S/T/O = Space/Time/Off). Not set if 'P' appears + -- in Ignore_Lines. Unit_Exception_Table : Boolean; - -- Set to True if unit exception table pointer generated. - -- Not set if 'P' appears in Ignore_Lines. + -- Set to True if unit exception table pointer generated. Not set if 'P' + -- appears in Ignore_Lines. Zero_Cost_Exceptions : Boolean; - -- Set to True if file was compiled with zero cost exceptions. - -- Not set if 'P' appears in Ignore_Lines. + -- Set to True if file was compiled with zero cost exceptions. Not set + -- if 'P' appears in Ignore_Lines. Restrictions : Restrictions_Info; -- Restrictions information reconstructed from R lines First_Interrupt_State : Interrupt_State_Id; Last_Interrupt_State : Interrupt_State_Id'Base; - -- These point to the first and last entries in the interrupt - -- state table for this unit. If there are no entries, then - -- Last_Interrupt_State = First_Interrupt_State - 1 (that's - -- why the 'Base reference is there, it can be one less than - -- the lower bound of the subtype). - -- Not set if 'I' appears in Ignore_Lines + -- These point to the first and last entries in the interrupt state + -- table for this unit. If no entries, then Last_Interrupt_State = + -- First_Interrupt_State - 1 (that's why the 'Base reference is there, + -- it can be one less than the lower bound of the subtype). Not set if + -- 'I' appears in Ignore_Lines First_Specific_Dispatching : Priority_Specific_Dispatching_Id; Last_Specific_Dispatching : Priority_Specific_Dispatching_Id'Base; diff --git a/gcc/ada/alloc.ads b/gcc/ada/alloc.ads index 317d3ffa3e1..3707ecf5543 100644 --- a/gcc/ada/alloc.ads +++ b/gcc/ada/alloc.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -141,6 +141,9 @@ package Alloc is Unreferenced_Entities_Initial : constant := 1_000; -- Sem_Warn Unreferenced_Entities_Increment : constant := 100; + Warnings_Off_Pragmas_Initial : constant := 500; -- Sem_Warn + Warnings_Off_Pragmas_Increment : constant := 100; + With_List_Initial : constant := 10; -- Features With_List_Increment : constant := 300; diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 414fd62d734..2f504ba7a9e 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -2738,12 +2738,13 @@ package body Atree is if Field2 (Cur_Node) not in Node_Range then return Traverse_Field (Cur_Node, Field2 (Cur_Node), 2); - elsif Is_Syntactic_Field (Nkind (Cur_Node), 2) and then - Field2 (Cur_Node) /= Empty_List_Or_Node + + elsif Is_Syntactic_Field (Nkind (Cur_Node), 2) + and then Field2 (Cur_Node) /= Empty_List_Or_Node then - -- Here is the tail recursion step, we reset Cur_Node and jump - -- back to the start of the procedure, which has the same - -- semantic effect as a call. + -- Here is the tail recursion step, we reset Cur_Node and jump back + -- to the start of the procedure, which has the same semantic effect + -- as a call. Cur_Node := Node_Id (Field2 (Cur_Node)); goto Tail_Recurse; diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 461049e325d..a943b3aa4eb 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -59,8 +59,8 @@ package body Back_End is File_Info_Array : array (1 .. Last_Source_File) of File_Info_Type; - procedure gigi ( - gnat_root : Int; + procedure gigi + (gnat_root : Int; max_gnat_node : Int; number_name : Nat; nodes_ptr : Address; @@ -90,13 +90,13 @@ package body Back_End is return; end if; - for I in 1 .. Last_Source_File loop - File_Info_Array (I).File_Name := Full_Debug_Name (I); - File_Info_Array (I).Num_Source_Lines := Num_Source_Lines (I); + for J in 1 .. Last_Source_File loop + File_Info_Array (J).File_Name := Full_Debug_Name (J); + File_Info_Array (J).Num_Source_Lines := Num_Source_Lines (J); end loop; - gigi ( - gnat_root => Int (Cunit (Main_Unit)), + gigi + (gnat_root => Int (Cunit (Main_Unit)), max_gnat_node => Int (Last_Node_Id - First_Node_Id + 1), number_name => Name_Entries_Count, nodes_ptr => Nodes_Address, @@ -131,26 +131,26 @@ package body Back_End is type Arg_Array is array (Nat) of BSP; type Arg_Array_Ptr is access Arg_Array; - -- Import flag_stack_check from toplev.c - flag_stack_check : Int; - pragma Import (C, flag_stack_check); -- Import from toplev.c + pragma Import (C, flag_stack_check); + -- Import from toplev.c save_argc : Nat; - pragma Import (C, save_argc); -- Import from toplev.c + pragma Import (C, save_argc); + -- Import from toplev.c save_argv : Arg_Array_Ptr; - pragma Import (C, save_argv); -- Import from toplev.c + pragma Import (C, save_argv); + -- Import from toplev.c Output_File_Name_Seen : Boolean := False; - -- Set to True after having scanned the file_name for - -- switch "-gnatO file_name" + -- Set to True after having scanned file_name for switch "-gnatO file" -- Local functions function Len_Arg (Arg : Pos) return Nat; - -- Determine length of argument number Arg on the original - -- command line from gnat1 + -- Determine length of argument number Arg on the original command line + -- from gnat1. procedure Scan_Back_End_Switches (Switch_Chars : String); -- Procedure to scan out switches stored in Switch_Chars. The first @@ -196,13 +196,12 @@ package body Back_End is Last := Last - 1; end if; - -- For these switches, skip following argument and do not - -- store either the switch or the following argument - - if Switch_Chars (First .. Last) = "o" - or else Switch_Chars (First .. Last) = "dumpbase" - or else Switch_Chars (First .. Last) = "-param" + -- For switches -o, -dumpbase, --param, skip following argument and + -- do not store either the switch or the following argument. + if Switch_Chars (First .. Last) = "o" or else + Switch_Chars (First .. Last) = "dumpbase" or else + Switch_Chars (First .. Last) = "-param" then Next_Arg := Next_Arg + 1; @@ -211,9 +210,9 @@ package body Back_End is elsif Switch_Chars (First .. Last) = "quiet" then null; - else - -- Store any other GCC switches + -- Store any other GCC switches + else Store_Compilation_Switch (Switch_Chars); -- Special check, the back end switch -fno-inline also sets the @@ -256,9 +255,9 @@ package body Back_End is Output_File_Name_Seen := True; end if; - -- If the previous switch has set the Search_Directory_Present - -- flag (that is if we have just seen -I), then the next - -- argument is a search directory path. + -- If the previous switch has set the Search_Directory_Present + -- flag (that is if we have just seen -I), then the next argument + -- is a search directory path. elsif Search_Directory_Present then if Is_Switch (Argv) then diff --git a/gcc/ada/back_end.ads b/gcc/ada/back_end.ads index 520c98b12d5..a382a733e52 100644 --- a/gcc/ada/back_end.ads +++ b/gcc/ada/back_end.ads @@ -52,15 +52,13 @@ package Back_End is procedure Scan_Compiler_Arguments; -- Acquires command-line parameters passed to the compiler and processes - -- them. Calls Scan_Front_End_Switches for any front-end switches - -- encountered. + -- them. Calls Scan_Front_End_Switches for any front-end switches found. -- - -- The processing of arguments is private to the back end, since - -- the way of acquiring the arguments as well as the set of allowable - -- back end switches is different depending on the particular back end - -- being used. + -- The processing of arguments is private to the back end, since the way + -- of acquiring the arguments as well as the set of allowable back end + -- switches is different depending on the particular back end being used. -- - -- Any processed switches that influence the result of a compilation - -- must be added to the Compilation_Arguments table. + -- Any processed switches that influence the result of a compilation must + -- be added to the Compilation_Arguments table. end Back_End; diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb index adab9588cf2..c397cc8dc92 100644 --- a/gcc/ada/bcheck.adb +++ b/gcc/ada/bcheck.adb @@ -51,6 +51,7 @@ package body Bcheck is procedure Check_Consistent_Interrupt_States; procedure Check_Consistent_Locking_Policy; procedure Check_Consistent_Normalize_Scalars; + procedure Check_Consistent_Optimize_Alignment; procedure Check_Consistent_Queuing_Policy; procedure Check_Consistent_Restrictions; procedure Check_Consistent_Zero_Cost_Exception_Handling; @@ -86,8 +87,8 @@ package body Bcheck is end if; Check_Consistent_Normalize_Scalars; + Check_Consistent_Optimize_Alignment; Check_Consistent_Dynamic_Elaboration_Checking; - Check_Consistent_Restrictions; Check_Consistent_Interrupt_States; Check_Consistent_Dispatching_Policy; @@ -657,12 +658,11 @@ package body Bcheck is -- then all other units in the partition must also be compiled with -- Normalized_Scalars in effect. - -- There is some issue as to whether this consistency check is - -- desirable, it is certainly required at the moment by the RM. - -- We should keep a watch on the ARG and HRG deliberations here. - -- GNAT no longer depends on this consistency (it used to do so, - -- but that has been corrected in the latest version, since the - -- Initialize_Scalars pragma does not require consistency. + -- There is some issue as to whether this consistency check is desirable, + -- it is certainly required at the moment by the RM. We should keep a watch + -- on the ARG and HRG deliberations here. GNAT no longer depends on this + -- consistency (it used to do so, but that is no longer the case, since + -- pragma Initialize_Scalars pragma does not require consistency.) procedure Check_Consistent_Normalize_Scalars is begin @@ -696,6 +696,44 @@ package body Bcheck is end if; end Check_Consistent_Normalize_Scalars; + ----------------------------------------- + -- Check_Consistent_Optimize_Alignment -- + ----------------------------------------- + + -- The rule is that all units other than internal units must be compiled + -- with the same setting for Optimize_Alignment. We can exclude internal + -- units since they are forced to compile with Optimize_Alignment (Off). + + procedure Check_Consistent_Optimize_Alignment is + OA_Setting : Character := ' '; + -- Reset when we find a non-internal unit + + OA_Unit : ALI_Id; + -- Id of unit from which OA_Setting was set + + begin + for A in ALIs.First .. ALIs.Last loop + if not Is_Internal_File_Name (ALIs.Table (A).Afile) then + if OA_Setting = ' ' then + OA_Setting := ALIs.Table (A).Optimize_Alignment_Setting; + OA_Unit := A; + + elsif OA_Setting = ALIs.Table (A).Optimize_Alignment_Setting then + null; + + else + Error_Msg_File_1 := ALIs.Table (OA_Unit).Sfile; + Error_Msg_File_2 := ALIs.Table (A).Sfile; + + Consistency_Error_Msg + ("{ and { compiled with different " + & "Optimize_Alignment settings"); + return; + end if; + end if; + end loop; + end Check_Consistent_Optimize_Alignment; + ------------------------------------- -- Check_Consistent_Queuing_Policy -- ------------------------------------- diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index d344959eea1..fa9ad8ff6f5 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -607,7 +607,7 @@ package body Bindgen is """__gnat_handler_installed"");"); -- Initialize stack limit variable of the environment task if the - -- stack check method is stack limit and if stack check is enabled. + -- stack check method is stack limit and stack check is enabled. if Stack_Check_Limits_On_Target and then (Stack_Check_Default_On_Target or Stack_Check_Switch_Set) @@ -619,6 +619,7 @@ package body Bindgen is end if; if VM_Target = CLI_Target + and then Bind_Main_Program and then not No_Main_Subprogram then WBI (""); @@ -782,7 +783,7 @@ package body Bindgen is end if; -- Initialize stack limit variable of the environment task if the - -- stack check method is stack limit and if stack check is enabled. + -- stack check method is stack limit and stack check is enabled. if Stack_Check_Limits_On_Target and then (Stack_Check_Default_On_Target or Stack_Check_Switch_Set) @@ -797,6 +798,7 @@ package body Bindgen is Gen_Elab_Calls_Ada; if VM_Target = CLI_Target + and then Bind_Main_Program and then not No_Main_Subprogram then if ALIs.Table (ALIs.First).Main_Program = Func then @@ -1033,7 +1035,7 @@ package body Bindgen is end if; -- Initialize stack limit for the environment task if the stack - -- check method is stack limit and if stack check is enabled. + -- check method is stack limit and stack check is enabled. if Stack_Check_Limits_On_Target and then (Stack_Check_Default_On_Target or Stack_Check_Switch_Set) @@ -2566,7 +2568,7 @@ package body Bindgen is end if; -- Initialize stack limit for the environment task if the stack - -- check method is stack limit and if stack check is enabled. + -- check method is stack limit and stack check is enabled. if Stack_Check_Limits_On_Target and then (Stack_Check_Default_On_Target or Stack_Check_Switch_Set) diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 0af10a6b1d6..d815a534a21 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -619,7 +619,7 @@ package body Checks is if Obj_Size /= No_Uint and then Exp_Size /= No_Uint and then Obj_Size > Exp_Size - and then not Warnings_Off (E) + and then not Has_Warnings_Off (E) then if Address_Clause_Overlay_Warnings then Error_Msg_FE @@ -3890,6 +3890,12 @@ package body Checks is -- If we fall through, a validity check is required Insert_Valid_Check (Expr); + + if Is_Entity_Name (Expr) + and then Safe_To_Capture_Value (Expr, Entity (Expr)) + then + Set_Is_Known_Valid (Entity (Expr)); + end if; end Ensure_Valid; ---------------------- diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 5d16e53b826..7a036cd6314 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -379,13 +379,26 @@ package body CStand is Set_Is_Pure (Standard_Standard); Set_Is_Compilation_Unit (Standard_Standard); - -- Create type declaration nodes for standard types + -- Create type/subtype declaration nodes for standard types for S in S_Types loop - Decl := New_Node (N_Full_Type_Declaration, Stloc); - Set_Defining_Identifier (Decl, Standard_Entity (S)); + + -- Subtype declaration case + + if S = S_Natural or else S = S_Positive then + Decl := New_Node (N_Subtype_Declaration, Stloc); + Set_Subtype_Indication (Decl, + New_Occurrence_Of (Standard_Integer, Stloc)); + + -- Full type declaration case + + else + Decl := New_Node (N_Full_Type_Declaration, Stloc); + end if; + Set_Is_Frozen (Standard_Entity (S)); Set_Is_Public (Standard_Entity (S)); + Set_Defining_Identifier (Decl, Standard_Entity (S)); Append (Decl, Decl_S); end loop; @@ -768,13 +781,7 @@ package body CStand is Set_Entity (E_Id, Standard_Positive); Set_Etype (E_Id, Standard_Positive); - -- Create subtype declaration for Natural - - Decl := New_Node (N_Subtype_Declaration, Stloc); - Set_Defining_Identifier (Decl, Standard_Natural); - Set_Subtype_Indication (Decl, - New_Occurrence_Of (Standard_Integer, Stloc)); - Append (Decl, Decl_S); + -- Setup entity for Naturalend Create_Standard; Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype); Set_Etype (Standard_Natural, Base_Type (Standard_Integer)); @@ -788,16 +795,8 @@ package body CStand is Lb => Uint_0, Hb => Intval (High_Bound (Scalar_Range (Standard_Integer)))); Set_Is_Constrained (Standard_Natural); - Set_Is_Frozen (Standard_Natural); - Set_Is_Public (Standard_Natural); - - -- Create subtype declaration for Positive - Decl := New_Node (N_Subtype_Declaration, Stloc); - Set_Defining_Identifier (Decl, Standard_Positive); - Set_Subtype_Indication (Decl, - New_Occurrence_Of (Standard_Integer, Stloc)); - Append (Decl, Decl_S); + -- Setup entity for Positive Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype); Set_Etype (Standard_Positive, Base_Type (Standard_Integer)); @@ -812,8 +811,6 @@ package body CStand is Lb => Uint_1, Hb => Intval (High_Bound (Scalar_Range (Standard_Integer)))); Set_Is_Constrained (Standard_Positive); - Set_Is_Frozen (Standard_Positive); - Set_Is_Public (Standard_Positive); -- Create declaration for package ASCII diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index b4ab4c6e7da..48ff50bd737 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -93,7 +93,7 @@ package body Debug is -- dY Enable configurable run-time mode -- dZ Generate listing showing the contents of the dispatch tables - -- d.a Disable OpenVMS alignment optimization on types + -- d.a -- d.b -- d.c -- d.d @@ -110,11 +110,11 @@ package body Debug is -- d.o -- d.p -- d.q - -- d.r + -- d.r Enable OK_To_Reorder_Components in non-variant records -- d.s Disable expansion of slice move, use memmove -- d.t Disable static allocation of library level dispatch tables -- d.u - -- d.v + -- d.v Enable OK_To_Reorder_Components in variant records -- d.w Do not check for infinite while loops -- d.x No exception handlers -- d.y @@ -138,8 +138,8 @@ package body Debug is -- d.P -- d.Q -- d.R - -- d.S - -- d.T + -- d.S Force Optimize_Alignment (Space) + -- d.T Force Optimize_Alignment (Time) -- d.U -- d.V -- d.W @@ -474,33 +474,32 @@ package body Debug is -- line has an internally generated number used for references between -- tagged types and primitives. For each primitive the output has the -- following fields: + -- -- - Letter 'P' or letter 's': The former indicates that this -- primitive will be located in a primary dispatch table. The -- latter indicates that it will be located in a secondary -- dispatch table. + -- -- - Name of the primitive. In case of predefined Ada primitives -- the text "(predefined)" is added before the name, and these -- acronyms are used: SR (Stream_Read), SW (Stream_Write), SI -- (Stream_Input), SO (Stream_Output), DA (Deep_Adjust), DF -- (Deep_Finalize). In addition Oeq identifies the equality -- operator, and "_assign" the assignment. + -- -- - If the primitive covers interface types, two extra fields -- referencing other primitives are generated: "Alias" references -- the primitive of the tagged type that covers an interface -- primitive, and "AI_Alias" references the covered interface -- primitive. + -- -- - The expression "at #xx" indicates the slot of the dispatch -- table occupied by such primitive in its corresponding primary -- or secondary dispatch table. + -- -- - In case of abstract subprograms the text "is abstract" is -- added at the end of the line. - -- d.a Disable OpenVMS alignment optimization on types. On OpenVMS, - -- record types whose size is odd "in between" (e.g. 17 bits) are - -- over-aligned to the next power of 2 (until 8 bytes). This over - -- alignment improve generated code and is more consistent with - -- what Dec Ada does. - -- d.f Suppress folding of static expressions. This of course results -- in seriously non-conforming behavior, but is useful sometimes -- when tracking down handling of complex expressions. @@ -520,6 +519,9 @@ package body Debug is -- main source (this corresponds to a previous behavior of -gnatl and -- is used for running the ACATS tests). + -- d.r Forces the flag OK_To_Reorder_Components to be set in all record + -- base types that have no discriminants. + -- d.s Normally the compiler expands slice moves into loops if overlap -- might be possible. This debug flag inhibits that expansion, and -- the back end is expected to use an appropriate routine to handle @@ -531,6 +533,9 @@ package body Debug is -- previous dynamic construction of tables. It is there as a possible -- work around if we run into trouble with the new implementation. + -- d.v Forces the flag OK_To_Reorder_Components to be set in all record + -- base types that have at least one discriminant (v = variant). + -- d.w This flag turns off the scanning of while loops to detect possible -- infinite loops. @@ -543,6 +548,10 @@ package body Debug is -- byte code, even in case of unsupported construct, for the sake -- of static analysis tools. + -- d.S Force Optimize_Alignment (Space) mode as the default + + -- d.T Force Optimize_Alignment (Time) mode as the default + -- d1 Error messages have node numbers where possible. Normally error -- messages have only source locations. This option is useful when -- debugging errors caused by expanded code, where the source location diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index c0306bdd8ef..0db79b57646 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -5035,7 +5035,7 @@ prepend_attributes (Entity_Id gnat_entity, struct attrib ** attr_list) (First (gnat_assoc))))))); } - switch (Get_Pragma_Id (Chars (gnat_temp))) + switch (Get_Pragma_Id (Pragma_Identifier (Chars (gnat_temp)))) { case Pragma_Machine_Attribute: etype = ATTR_MACHINE_ATTRIBUTE; @@ -5529,18 +5529,6 @@ maybe_pad_type (tree type, tree size, unsigned int align, if (align == 0 && !size) return type; - /* If no size is specified and we have an integral type, and changing - the alignment won't change its size, return a copy of the type - with the specified alignment. */ - if (!size - && INTEGRAL_TYPE_P (type) - && value_factor_p (orig_size, align)) - { - type = copy_type (type); - TYPE_ALIGN (type) = align; - return type; - } - /* We used to modify the record in place in some cases, but that could generate incorrect debugging information. So make a new record type and name. */ @@ -7080,10 +7068,11 @@ check_ok_for_atomic (tree object, Entity_Id gnat_entity, bool comp_p) gnat_node = Next_Rep_Item (gnat_node)) { if (!comp_p && Nkind (gnat_node) == N_Pragma - && Get_Pragma_Id (Chars (gnat_node)) == Pragma_Atomic) + && (Get_Pragma_Id (Chars (Pragma_Identifier (gnat_node))) + == Pragma_Atomic)) gnat_error_point = First (Pragma_Argument_Associations (gnat_node)); else if (comp_p && Nkind (gnat_node) == N_Pragma - && (Get_Pragma_Id (Chars (gnat_node)) + && (Get_Pragma_Id (Chars (Pragma_Identifier (gnat_node))) == Pragma_Atomic_Components)) gnat_error_point = First (Pragma_Argument_Associations (gnat_node)); } diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index d8be3e75932..c04680c342a 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -495,13 +495,12 @@ package body Einfo is -- Renamed_In_Spec Flag231 -- Implemented_By_Entry Flag232 -- Has_Pragma_Unmodified Flag233 - - -- (unused) Flag234 - -- (unused) Flag235 - -- (unused) Flag236 - -- (unused) Flag237 - -- (unused) Flag238 - -- (unused) Flag239 + -- Is_Static_Dispatch_Table_Entity Flag234 + -- Is_Trivial_Subprogram Flag235 + -- Warnings_Off_Used Flag236 + -- Warnings_Off_Used_Unmodified Flag237 + -- Warnings_Off_Used_Unreferenced Flag238 + -- OK_To_Reorder_Components Flag239 -- (unused) Flag240 -- (unused) Flag241 @@ -1044,7 +1043,7 @@ package body Einfo is function Can_Use_Internal_Rep (Id : E) return B is begin - pragma Assert (Ekind (Id) in Access_Subprogram_Type_Kind); + pragma Assert (Is_Access_Subprogram_Type (Id)); return Flag229 (Id); end Can_Use_Internal_Rep; @@ -2001,6 +2000,11 @@ package body Einfo is return Flag28 (Id); end Is_Statically_Allocated; + function Is_Static_Dispatch_Table_Entity (Id : E) return B is + begin + return Flag234 (Id); + end Is_Static_Dispatch_Table_Entity; + function Is_Synchronized_Interface (Id : E) return B is begin pragma Assert (Is_Interface (Id)); @@ -2030,6 +2034,11 @@ package body Einfo is return Flag225 (Id); end Is_Thunk; + function Is_Trivial_Subprogram (Id : E) return B is + begin + return Flag235 (Id); + end Is_Trivial_Subprogram; + function Is_True_Constant (Id : E) return B is begin return Flag163 (Id); @@ -2272,6 +2281,12 @@ package body Einfo is return Node24 (Id); end Obsolescent_Warning; + function OK_To_Reorder_Components (Id : E) return B is + begin + pragma Assert (Is_Record_Type (Id)); + return Flag239 (Base_Type (Id)); + end OK_To_Reorder_Components; + function Original_Array_Type (Id : E) return E is begin pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id)); @@ -2645,6 +2660,21 @@ package body Einfo is return Flag96 (Id); end Warnings_Off; + function Warnings_Off_Used (Id : E) return B is + begin + return Flag236 (Id); + end Warnings_Off_Used; + + function Warnings_Off_Used_Unmodified (Id : E) return B is + begin + return Flag237 (Id); + end Warnings_Off_Used_Unmodified; + + function Warnings_Off_Used_Unreferenced (Id : E) return B is + begin + return Flag238 (Id); + end Warnings_Off_Used_Unreferenced; + function Wrapped_Entity (Id : E) return E is begin pragma Assert (Ekind (Id) = E_Procedure @@ -2671,6 +2701,11 @@ package body Einfo is return Ekind (Id) in Access_Protected_Kind; end Is_Access_Protected_Subprogram_Type; + function Is_Access_Subprogram_Type (Id : E) return B is + begin + return Ekind (Id) in Access_Subprogram_Kind; + end Is_Access_Subprogram_Type; + function Is_Array_Type (Id : E) return B is begin return Ekind (Id) in Array_Kind; @@ -3380,7 +3415,7 @@ package body Einfo is procedure Set_Can_Use_Internal_Rep (Id : E; V : B := True) is begin - pragma Assert (Ekind (Id) in Access_Subprogram_Type_Kind); + pragma Assert (Is_Access_Subprogram_Type (Id)); Set_Flag229 (Id, V); end Set_Can_Use_Internal_Rep; @@ -4385,6 +4420,11 @@ package body Einfo is Set_Flag28 (Id, V); end Set_Is_Statically_Allocated; + procedure Set_Is_Static_Dispatch_Table_Entity (Id : E; V : B := True) is + begin + Set_Flag234 (Id, V); + end Set_Is_Static_Dispatch_Table_Entity; + procedure Set_Is_Synchronized_Interface (Id : E; V : B := True) is begin pragma Assert (Is_Interface (Id)); @@ -4415,6 +4455,11 @@ package body Einfo is Set_Flag225 (Id, V); end Set_Is_Thunk; + procedure Set_Is_Trivial_Subprogram (Id : E; V : B := True) is + begin + Set_Flag235 (Id, V); + end Set_Is_Trivial_Subprogram; + procedure Set_Is_True_Constant (Id : E; V : B := True) is begin Set_Flag163 (Id, V); @@ -4661,6 +4706,13 @@ package body Einfo is Set_Node24 (Id, V); end Set_Obsolescent_Warning; + procedure Set_OK_To_Reorder_Components (Id : E; V : B := True) is + begin + pragma Assert + (Is_Record_Type (Id) and then Id = Base_Type (Id)); + Set_Flag239 (Id, V); + end Set_OK_To_Reorder_Components; + procedure Set_Original_Array_Type (Id : E; V : E) is begin pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id)); @@ -5040,6 +5092,21 @@ package body Einfo is Set_Flag96 (Id, V); end Set_Warnings_Off; + procedure Set_Warnings_Off_Used (Id : E; V : B := True) is + begin + Set_Flag236 (Id, V); + end Set_Warnings_Off_Used; + + procedure Set_Warnings_Off_Used_Unmodified (Id : E; V : B := True) is + begin + Set_Flag237 (Id, V); + end Set_Warnings_Off_Used_Unmodified; + + procedure Set_Warnings_Off_Used_Unreferenced (Id : E; V : B := True) is + begin + Set_Flag238 (Id, V); + end Set_Warnings_Off_Used_Unreferenced; + procedure Set_Was_Hidden (Id : E; V : B := True) is begin Set_Flag196 (Id, V); @@ -5969,7 +6036,7 @@ package body Einfo is begin N := First_Rep_Item (E); while Present (N) loop - if Nkind (N) = N_Pragma and then Chars (N) = Nam then + if Nkind (N) = N_Pragma and then Pragma_Name (N) = Nam then return N; end if; @@ -5992,7 +6059,7 @@ package body Einfo is Ritem := First_Rep_Item (Id); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Chars (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then return True; else @@ -6020,8 +6087,7 @@ package body Einfo is ----------------- function Has_Entries (Id : E) return B is - Result : Boolean := False; - Ent : Entity_Id; + Ent : Entity_Id; begin pragma Assert (Is_Concurrent_Type (Id)); @@ -6029,14 +6095,13 @@ package body Einfo is Ent := First_Entity (Id); while Present (Ent) loop if Is_Entry (Ent) then - Result := True; - exit; + return True; end if; Ent := Next_Entity (Ent); end loop; - return Result; + return False; end Has_Entries; ---------------------------- @@ -6061,7 +6126,7 @@ package body Einfo is Ritem := First_Rep_Item (Id); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Chars (Ritem) = Name_Interrupt_Handler + and then Pragma_Name (Ritem) = Name_Interrupt_Handler then return True; else @@ -6079,15 +6144,12 @@ package body Einfo is function Has_Private_Ancestor (Id : E) return B is R : constant Entity_Id := Root_Type (Id); T1 : Entity_Id := Id; - begin loop if Is_Private_Type (T1) then return True; - elsif T1 = R then return False; - else T1 := Etype (T1); end if; @@ -6103,6 +6165,52 @@ package body Einfo is return Present (Get_Rep_Pragma (E, Nam)); end Has_Rep_Pragma; + -------------------- + -- Has_Unmodified -- + -------------------- + + function Has_Unmodified (E : Entity_Id) return Boolean is + begin + if Has_Pragma_Unmodified (E) then + return True; + elsif Warnings_Off (E) then + Set_Warnings_Off_Used_Unmodified (E); + return True; + else + return False; + end if; + end Has_Unmodified; + + --------------------- + -- Has_Unreferenced -- + --------------------- + + function Has_Unreferenced (E : Entity_Id) return Boolean is + begin + if Has_Pragma_Unreferenced (E) then + return True; + elsif Warnings_Off (E) then + Set_Warnings_Off_Used_Unreferenced (E); + return True; + else + return False; + end if; + end Has_Unreferenced; + + ---------------------- + -- Has_Warnings_Off -- + ---------------------- + + function Has_Warnings_Off (E : Entity_Id) return Boolean is + begin + if Warnings_Off (E) then + Set_Warnings_Off_Used (E); + return True; + else + return False; + end if; + end Has_Warnings_Off; + ------------------------------ -- Implementation_Base_Type -- ------------------------------ @@ -7396,11 +7504,13 @@ package body Einfo is W ("Is_Return_Object", Flag209 (Id)); W ("Is_Shared_Passive", Flag60 (Id)); W ("Is_Synchronized_Interface", Flag199 (Id)); + W ("Is_Static_Dispatch_Table_Entity", Flag234 (Id)); W ("Is_Statically_Allocated", Flag28 (Id)); W ("Is_Tag", Flag78 (Id)); W ("Is_Tagged_Type", Flag55 (Id)); W ("Is_Task_Interface", Flag200 (Id)); W ("Is_Thunk", Flag225 (Id)); + W ("Is_Trivial_Subprogram", Flag235 (Id)); W ("Is_True_Constant", Flag163 (Id)); W ("Is_Unchecked_Union", Flag117 (Id)); W ("Is_Unsigned_Type", Flag144 (Id)); @@ -7427,6 +7537,7 @@ package body Einfo is W ("No_Strict_Aliasing", Flag136 (Id)); W ("Non_Binary_Modulus", Flag58 (Id)); W ("Nonzero_Is_True", Flag162 (Id)); + W ("OK_To_Reorder_Components", Flag239 (Id)); W ("Reachable", Flag49 (Id)); W ("Referenced", Flag156 (Id)); W ("Referenced_As_LHS", Flag36 (Id)); @@ -7452,6 +7563,9 @@ package body Einfo is W ("Uses_Sec_Stack", Flag95 (Id)); W ("Vax_Float", Flag151 (Id)); W ("Warnings_Off", Flag96 (Id)); + W ("Warnings_Off_Used", Flag236 (Id)); + W ("Warnings_Off_Used_Unmodified", Flag237 (Id)); + W ("Warnings_Off_Used_Unreferenced", Flag238 (Id)); W ("Was_Hidden", Flag196 (Id)); end Write_Entity_Flags; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 6a98477c3c3..45e5e5ba014 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -334,10 +334,17 @@ package Einfo is -- Access_Disp_Table (Elist16) [implementation base type only] -- Present in record type entities. For a tagged type, points to the --- dispatch tables associated with the tagged type; the last entity of --- this list is an access type declaration used to expand dispatching --- calls through the primary dispatch table. For a non-tagged record, --- contains Empty. +-- dispatch tables associated with the tagged type. The first two +-- entities correspond with the primary dispatch table: 1) primary +-- dispatch table with user-defined primitives, 2) primary dispatch table +-- with predefined primitives. For each interface type covered by the +-- tagged type we also have: 3) secondary dispatch table with thunks of +-- primitives covering user-defined interface primitives, 4) secondary +-- dispatch table with thunks of predefined primitives, 5) secondary +-- dispatch table with user-defined primitives, and 6) secondary dispatch +-- table with predefined primitives. The last entity of this list is an +-- access type declaration used to expand dispatching calls through the +-- primary dispatch table. For a non-tagged record, contains Empty. -- Address_Clause (synthesized) -- Applies to entries, objects and subprograms. Set if an address clause @@ -1072,11 +1079,11 @@ package Einfo is -- being computed. -- Can_Use_Internal_Rep (Flag229) --- Present in Access_Subprogram_Type_Kind nodes. This flag is set by --- the front end and used by the back end. False means that the back end +-- Present in Access_Subprogram_Kind nodes. This flag is set by the +-- front end and used by the back end. False means that the back end -- must represent the type in the same way as Convention-C types (and --- other foreign-convention types). On many targets, this means that the --- back end will use dynamically generated trampolines for nested +-- other foreign-convention types). On many targets, this means that +-- the back end will use dynamically generated trampolines for nested -- subprograms. True means that the back end can represent the type in -- some internal way. On the aforementioned targets, this means that the -- back end will not use dynamically generated trampolines. This flag @@ -1625,14 +1632,17 @@ package Einfo is -- Present in all entities. Can only be set for variables (E_Variable, -- E_Out_Parameter, E_In_Out_Parameter). Set if a valid pragma Unmodified -- applies to the variable, indicating that no warning should be given --- if the entity is never modified. +-- if the entity is never modified. Note that clients should generally +-- not test this flag directly, but instead use function Has_Unmodified. -- Has_Pragma_Unreferenced (Flag180) -- Present in all entities. Set if a valid pragma Unreferenced applies -- to the entity, indicating that no warning should be given if the -- entity has no references, but a warning should be given if it is -- in fact referenced. For private types, this flag is set in both the --- private entity and full entity if the pragma applies to either. +-- private entity and full entity if the pragma applies to either. Note +-- that clients should generally not test this flag directly, but instead +-- use function Has_Unreferenced. -- Has_Pragma_Unreferenced_Objects (Flag212) -- Present in type and subtype entities. Set if a valid pragma @@ -2613,9 +2623,13 @@ package Einfo is -- flag set (since to allocate the oject statically, its type must -- also be elaborated globally). +-- Is_Static_Dispatch_Table_Entity (Flag234) +-- Applies to all entities. Set to indicate to the backend that this +-- entity is associated with an statically allocated dispatch table. + -- Is_Subprogram (synthesized) --- Applies to all entities, true for bodies of functions, procedures --- and operators. +-- Applies to all entities, true for function, procedure and operator +-- entities. -- Is_String_Type (synthesized) -- Applies to all type entities. Determines if the given type is a @@ -2649,13 +2663,20 @@ package Einfo is -- Applies to all entities. True for task types and subtypes -- Is_Thunk (Flag225) --- True for subprograms that are thunks. Thunks are small subprograms --- built by the expander for tagged types that cover interface types; --- at run-time thunks displace the pointer to the object (pointer named --- "this" in the C++ terminology) from a secondary dispatch table to the --- primary dispatch table associated with a given tagged type. Set by --- Expand_Interface Thunk and used by Expand_Call to handle extra actuals --- associated with accessibility level. +-- Present in all entities for subprograms (functions, procedures, and +-- operators). True for subprograms that are thunks, that is small +-- subprograms built by the expander for tagged types that cover +-- interface types. At run-time thunks displace the pointer to the object +-- (pointer named "this" in the C++ terminology) from a secondary +-- dispatch table to the primary dispatch table associated with a given +-- tagged type. Set by Expand_Interface Thunk and used by Expand_Call to +-- handle extra actuals associated with accessibility level. + +-- Is_Trivial_Subprogram (Flag235) +-- Present in all entities. Set in subprograms where either the body +-- consists of a single null statement, or the first or only statement +-- of the body raises an exception. This is used for suppressing certain +-- warnings, see Sem_Ch6.Analyze_Subprogram_Body discussion for details. -- Is_True_Constant (Flag163) -- Present in all entities for constants and variables. Set in constants @@ -2869,13 +2890,15 @@ package Einfo is -- to the freeze point because of the rule about overriding Initialize). -- Needs_Debug_Info (Flag147) --- Present in all entities. Set if the entity requires debugging --- information to be generated. This is true of all entities that --- have Comes_From_Source set, and also transitively for entities --- associated with such components (e.g. their types). It is true --- for all entities in Debug_Generated_Code mode (-gnatD switch). --- This is the flag that the back end should check to determine --- whether or not to generate debugging information for an entity. +-- Present in all entities. Set if the entity requires normal debugging +-- information to be generated. This is true of all entities that have +-- Comes_From_Source set, and also transitively for entities associated +-- with such components (e.g. their types). It is true for all entities +-- in Debug_Generated_Code mode (-gnatD switch). This is the flag that +-- the back end should check to determine whether or not to generate +-- debugging information for an entity. Note that callers should always +-- use Sem_Util.Set_Debug_Info_Needed, rather than Set_Needs_Debug_Info, +-- so that the flag is set properly on subsidiary entities. -- Needs_No_Actuals (Flag22) -- Present in callable entities (subprograms, entries, access to @@ -3089,6 +3112,12 @@ package Einfo is -- Protection object associated with a protected object. See Prival -- for further details on the use of privals. +-- OK_To_Reorder_Components (Flag239) [base type only] +-- Present in record types. Set if the back end is permitted to reorder +-- the components. If not set, the record must be layed out in the order +-- in which the components are declared textually. Currently this flag +-- can only be set by debug switches. + -- Original_Record_Component (Node22) -- Present in components, including discriminants. The usage depends -- on whether the record is a base type and whether it is tagged. @@ -3639,7 +3668,26 @@ package Einfo is -- Warnings_Off (Flag96) -- Present in all entities. Set if a pragma Warnings (Off, entity-name) -- is used to suppress warnings for a given entity. It is also used by --- the compiler in some situations to kill spurious warnings. +-- the compiler in some situations to kill spurious warnings. Note that +-- clients should generally not test this flag directly, but instead +-- use function Has_Warnings_Off. + +-- Warnings_Off_Used (Flag236) +-- Present in all entities. Can only be set if Warnings_Off is set. If +-- set indicates that a warning was suppressed by the Warnings_Off flag, +-- and Unmodified/Unreferenced would not have suppressed the warning. + +-- Warnings_Off_Used_Unmodified (Flag237) +-- Present in all entities. Can only be set if Warnings_Off is set and +-- Has_Pragma_Unmodified is not set. If set indicates that a warning was +-- suppressed by the Warnings_Off status but that pragma Unmodified +-- would also have suppressed the warning. + +-- Warnings_Off_Used_Unreferenced (Flag238) +-- Present in all entities. Can only be set if Warnings_Off is set and +-- Has_Pragma_Unreferenced is not set. If set indicates that a warning +-- was suppressed by the Warnings_Off status but that pragma Unreferenced +-- would also have suppressed the warning. -- Was_Hidden (Flag196) -- Present in all entities. Used to save the value of the Is_Hidden @@ -4121,7 +4169,7 @@ package Einfo is -- E_Anonymous_Access_Protected_Subprogram_Type E_Anonymous_Access_Type; - subtype Access_Subprogram_Type_Kind is Entity_Kind range + subtype Access_Subprogram_Kind is Entity_Kind range E_Access_Subprogram_Type .. -- E_Anonymous_Access_Subprogram_Type -- E_Access_Protected_Subprogram_Type @@ -4526,8 +4574,10 @@ package Einfo is -- Is_Remote_Types (Flag61) -- Is_Renaming_Of_Object (Flag112) -- Is_Shared_Passive (Flag60) + -- Is_Static_Dispatch_Table_Entity (Flag234) -- Is_Statically_Allocated (Flag28) -- Is_Tagged_Type (Flag55) + -- Is_Trivial_Subprogram (Flag235) -- Is_Unchecked_Union (Flag117) -- Is_Visible_Formal (Flag206) -- Is_VMS_Exception (Flag133) @@ -4547,6 +4597,9 @@ package Einfo is -- Suppress_Value_Tracking_On_Call (Flag217) -- Used_As_Generic_Actual (Flag222) -- Warnings_Off (Flag96) + -- Warnings_Off_Used (Flag236) + -- Warnings_Off_Used_Unmodified (Flag237) + -- Warnings_Off_Used_Unreferenced (Flag238) -- Was_Hidden (Flag196) -- Declaration_Node (synth) @@ -5280,6 +5333,7 @@ package Einfo is -- Is_Controlled (Flag42) (base type only) -- Is_Interface (Flag186) -- Is_Limited_Interface (Flag197) + -- OK_To_Reorder_Components (Flag239) (base type only) -- Reverse_Bit_Order (Flag164) (base type only) -- First_Component (synth) -- First_Component_Or_Discriminant (synth) @@ -5309,6 +5363,7 @@ package Einfo is -- Is_Controlled (Flag42) (base type only) -- Is_Interface (Flag186) -- Is_Limited_Interface (Flag197) + -- OK_To_Reorder_Components (Flag239) (base type only) -- Reverse_Bit_Order (Flag164) (base type only) -- First_Component (synth) -- First_Component_Or_Discriminant (synth) @@ -5896,12 +5951,14 @@ package Einfo is function Is_Renaming_Of_Object (Id : E) return B; function Is_Return_Object (Id : E) return B; function Is_Shared_Passive (Id : E) return B; + function Is_Static_Dispatch_Table_Entity (Id : E) return B; function Is_Statically_Allocated (Id : E) return B; function Is_Synchronized_Interface (Id : E) return B; function Is_Tag (Id : E) return B; function Is_Tagged_Type (Id : E) return B; function Is_Task_Interface (Id : E) return B; function Is_Thunk (Id : E) return B; + function Is_Trivial_Subprogram (Id : E) return B; function Is_True_Constant (Id : E) return B; function Is_Unchecked_Union (Id : E) return B; function Is_Unsigned_Type (Id : E) return B; @@ -5943,6 +6000,7 @@ package Einfo is function Normalized_Position_Max (Id : E) return U; function Object_Ref (Id : E) return E; function Obsolescent_Warning (Id : E) return N; + function OK_To_Reorder_Components (Id : E) return B; function Original_Array_Type (Id : E) return E; function Original_Record_Component (Id : E) return E; function Overridden_Operation (Id : E) return E; @@ -6008,6 +6066,9 @@ package Einfo is function Uses_Sec_Stack (Id : E) return B; function Vax_Float (Id : E) return B; function Warnings_Off (Id : E) return B; + function Warnings_Off_Used (Id : E) return B; + function Warnings_Off_Used_Unmodified (Id : E) return B; + function Warnings_Off_Used_Unreferenced (Id : E) return B; function Was_Hidden (Id : E) return B; function Wrapped_Entity (Id : E) return E; @@ -6023,6 +6084,7 @@ package Einfo is function Is_Access_Type (Id : E) return B; function Is_Access_Protected_Subprogram_Type (Id : E) return B; + function Is_Access_Subprogram_Type (Id : E) return B; function Is_Array_Type (Id : E) return B; function Is_Assignable (Id : E) return B; function Is_Class_Wide_Type (Id : E) return B; @@ -6446,12 +6508,14 @@ package Einfo is procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True); procedure Set_Is_Return_Object (Id : E; V : B := True); procedure Set_Is_Shared_Passive (Id : E; V : B := True); + procedure Set_Is_Static_Dispatch_Table_Entity (Id : E; V : B := True); procedure Set_Is_Statically_Allocated (Id : E; V : B := True); procedure Set_Is_Synchronized_Interface (Id : E; V : B := True); procedure Set_Is_Tag (Id : E; V : B := True); procedure Set_Is_Tagged_Type (Id : E; V : B := True); procedure Set_Is_Task_Interface (Id : E; V : B := True); procedure Set_Is_Thunk (Id : E; V : B := True); + procedure Set_Is_Trivial_Subprogram (Id : E; V : B := True); procedure Set_Is_True_Constant (Id : E; V : B := True); procedure Set_Is_Unchecked_Union (Id : E; V : B := True); procedure Set_Is_Unsigned_Type (Id : E; V : B := True); @@ -6493,6 +6557,7 @@ package Einfo is procedure Set_Normalized_Position_Max (Id : E; V : U); procedure Set_Object_Ref (Id : E; V : E); procedure Set_Obsolescent_Warning (Id : E; V : N); + procedure Set_OK_To_Reorder_Components (Id : E; V : B := True); procedure Set_Original_Array_Type (Id : E; V : E); procedure Set_Original_Record_Component (Id : E; V : E); procedure Set_Overridden_Operation (Id : E; V : E); @@ -6558,6 +6623,9 @@ package Einfo is procedure Set_Uses_Sec_Stack (Id : E; V : B := True); procedure Set_Vax_Float (Id : E; V : B := True); procedure Set_Warnings_Off (Id : E; V : B := True); + procedure Set_Warnings_Off_Used (Id : E; V : B := True); + procedure Set_Warnings_Off_Used_Unmodified (Id : E; V : B := True); + procedure Set_Warnings_Off_Used_Unreferenced (Id : E; V : B := True); procedure Set_Was_Hidden (Id : E; V : B := True); procedure Set_Wrapped_Entity (Id : E; V : E); @@ -6678,6 +6746,33 @@ package Einfo is procedure Next_Stored_Discriminant (N : in out Node_Id) renames Proc_Next_Stored_Discriminant; + --------------------------- + -- Testing Warning Flags -- + --------------------------- + + -- These routines are to be used rather than testing flags Warnings_Off, + -- Has_Pragma_Unmodified, Has_Pragma_Unreferenced. They deal with setting + -- the flags Warnings_Off_Used[_Unmodified|Unreferenced] for later access. + + function Has_Warnings_Off (E : Entity_Id) return Boolean; + -- If Warnings_Off is set on E, then returns True and also sets the flag + -- Warnings_Off_Used on E. If Warnings_Off is not set on E, returns False + -- and has no side effect. + + function Has_Unmodified (E : Entity_Id) return Boolean; + -- If flag Has_Pragma_Unmodified is set on E, returns True with no side + -- effects. Otherwise if Warnings_Off is set on E, returns True and also + -- sets the flag Warnings_Off_Used_Unmodified on E. If neither of the flags + -- Warnings_Off nor Has_Pragma_Unmodified is set, returns False with no + -- side effects. + + function Has_Unreferenced (E : Entity_Id) return Boolean; + -- If flag Has_Pragma_Unreferenced is set on E, returns True with no side + -- effects. Otherwise if Warnings_Off is set on E, returns True and also + -- sets the flag Warnings_Off_Used_Unreferenced on E. If neither of the + -- flags Warnings_Off nor Has_Pragma_Unreferenced is set, returns False + -- with no side effects. + ---------------------------------------------- -- Subprograms for Accessing Rep Item Chain -- ---------------------------------------------- @@ -6984,6 +7079,7 @@ package Einfo is pragma Inline (Is_Ada_2005_Only); pragma Inline (Is_Access_Type); pragma Inline (Is_Access_Protected_Subprogram_Type); + pragma Inline (Is_Access_Subprogram_Type); pragma Inline (Is_Aliased); pragma Inline (Is_Array_Type); pragma Inline (Is_Assignable); @@ -7093,6 +7189,7 @@ package Einfo is pragma Inline (Is_Scalar_Type); pragma Inline (Is_Shared_Passive); pragma Inline (Is_Signed_Integer_Type); + pragma Inline (Is_Static_Dispatch_Table_Entity); pragma Inline (Is_Statically_Allocated); pragma Inline (Is_Subprogram); pragma Inline (Is_Synchronized_Interface); @@ -7102,6 +7199,7 @@ package Einfo is pragma Inline (Is_True_Constant); pragma Inline (Is_Task_Type); pragma Inline (Is_Thunk); + pragma Inline (Is_Trivial_Subprogram); pragma Inline (Is_Type); pragma Inline (Is_Unchecked_Union); pragma Inline (Is_Unsigned_Type); @@ -7144,6 +7242,7 @@ package Einfo is pragma Inline (Normalized_Position_Max); pragma Inline (Object_Ref); pragma Inline (Obsolescent_Warning); + pragma Inline (OK_To_Reorder_Components); pragma Inline (Original_Array_Type); pragma Inline (Original_Record_Component); pragma Inline (Overridden_Operation); @@ -7210,6 +7309,9 @@ package Einfo is pragma Inline (Uses_Sec_Stack); pragma Inline (Vax_Float); pragma Inline (Warnings_Off); + pragma Inline (Warnings_Off_Used); + pragma Inline (Warnings_Off_Used_Unmodified); + pragma Inline (Warnings_Off_Used_Unreferenced); pragma Inline (Was_Hidden); pragma Inline (Wrapped_Entity); @@ -7470,12 +7572,14 @@ package Einfo is pragma Inline (Set_Is_Renaming_Of_Object); pragma Inline (Set_Is_Return_Object); pragma Inline (Set_Is_Shared_Passive); + pragma Inline (Set_Is_Static_Dispatch_Table_Entity); pragma Inline (Set_Is_Statically_Allocated); pragma Inline (Set_Is_Synchronized_Interface); pragma Inline (Set_Is_Tag); pragma Inline (Set_Is_Tagged_Type); pragma Inline (Set_Is_Task_Interface); pragma Inline (Set_Is_Thunk); + pragma Inline (Set_Is_Trivial_Subprogram); pragma Inline (Set_Is_True_Constant); pragma Inline (Set_Is_Unchecked_Union); pragma Inline (Set_Is_Unsigned_Type); @@ -7517,6 +7621,7 @@ package Einfo is pragma Inline (Set_Normalized_Position_Max); pragma Inline (Set_Object_Ref); pragma Inline (Set_Obsolescent_Warning); + pragma Inline (Set_OK_To_Reorder_Components); pragma Inline (Set_Original_Array_Type); pragma Inline (Set_Original_Record_Component); pragma Inline (Set_Overridden_Operation); @@ -7582,6 +7687,9 @@ package Einfo is pragma Inline (Set_Uses_Sec_Stack); pragma Inline (Set_Vax_Float); pragma Inline (Set_Warnings_Off); + pragma Inline (Set_Warnings_Off_Used); + pragma Inline (Set_Warnings_Off_Used_Unmodified); + pragma Inline (Set_Warnings_Off_Used_Unreferenced); pragma Inline (Set_Was_Hidden); pragma Inline (Set_Wrapped_Entity); diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index e0f649222d6..106af0aa5ca 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -766,6 +766,11 @@ package body Errout is elsif Debug_Flag_GG then null; + -- Keep warning if message text ends in !! + + elsif Msg (Msg'Last) = '!' and then Msg (Msg'Last - 1) = '!' then + null; + -- Here is where we delete a warning from a with'ed unit else @@ -1364,12 +1369,12 @@ package body Errout is if Error_Posted (N) then return True; - elsif Nkind (N) in N_Entity and then Warnings_Off (N) then + elsif Nkind (N) in N_Entity and then Has_Warnings_Off (N) then return True; elsif Is_Entity_Name (N) and then Present (Entity (N)) - and then Warnings_Off (Entity (N)) + and then Has_Warnings_Off (Entity (N)) then return True; @@ -2392,14 +2397,17 @@ package body Errout is end if; -- The only remaining possibilities are identifiers, defining - -- identifiers, pragmas, and pragma argument associations, i.e. - -- nodes that have a Chars field. + -- identifiers, pragmas, and pragma argument associations. - -- Internal names generally represent something gone wrong. An exception - -- is the case of internal type names, where we try to find a reasonable - -- external representation for the external name + if Nkind (Node) = N_Pragma then + Nam := Pragma_Name (Node); - if Is_Internal_Name (Chars (Node)) + -- The other cases have Chars fields, and we want to test for possible + -- internal names, which generally represent something gone wrong. An + -- exception is the case of internal type names, where we try to find a + -- reasonable external representation for the external name + + elsif Is_Internal_Name (Chars (Node)) and then ((Is_Entity_Name (Node) and then Present (Entity (Node)) @@ -2423,6 +2431,8 @@ package body Errout is Nam := Chars (Ent); end if; + -- If not internal name, just use name in Chars field + else Nam := Chars (Node); end if; diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index f58181eb018..b9b0616fe1c 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -120,7 +120,8 @@ package Errout is -- reference to the Any_Type node, then the message is suppressed. -- 6. Note that cases 2-5 only apply to error messages, not warning - -- messages. Warning messages are only suppressed for case 1. + -- messages. Warning messages are only suppressed for case 1, and + -- when they come from other than the main extended unit. -- This normal suppression action may be overridden in cases 2-5 (but not -- in case 1) by setting All_Errors mode, or by setting the special @@ -264,6 +265,13 @@ package Errout is -- it, since it makes it clear that the continuation is part of an -- unconditional message. + -- Insertion character !! (unconditional warning) + + -- Normally warning messages issued in other than the main unit are + -- suppressed. If the message ends with !! then this suppression is + -- avoided. This is currently only used by the Compile_Time_Warning + -- pragma to ensure the message for a with'ed unit is output. + -- Insertion character ? (Question: warning message) -- The character ? appearing anywhere in a message makes the message -- warning instead of a normal error message, and the text of the diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index 6f928b02c28..383f0189bc3 100644 --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -1201,7 +1201,11 @@ package body Erroutc is Is_Style_Msg := (Msg'Length > 7 - and then Msg (Msg'First .. Msg'First + 6) = "(style)"); + and then Msg (Msg'First .. Msg'First + 6) = "(style)"); + + if Is_Style_Msg then + Is_Serious_Error := False; + end if; for J in Msg'Range loop if Msg (J) = '?' diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index f1e7fb4cfbb..c334150b84a 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1990,12 +1990,11 @@ package body Exp_Aggr is Selector_Name => Make_Identifier (Loc, Name_uController)); Set_Assignment_OK (Ref); - -- Ada 2005 (AI-287): Give support to aggregates of limited - -- types. If the type is intrinsically_limited the controller - -- is limited as well. If it is tagged and limited then so is - -- the controller. Otherwise an untagged type may have limited - -- components without its full view being limited, so the - -- controller is not limited. + -- Ada 2005 (AI-287): Give support to aggregates of limited types. + -- If the type is intrinsically limited the controller is limited as + -- well. If it is tagged and limited then so is the controller. + -- Otherwise an untagged type may have limited components without its + -- full view being limited, so the controller is not limited. if Nkind (Target) = N_Identifier then Target_Type := Etype (Target); @@ -2016,8 +2015,8 @@ package body Exp_Aggr is end if; -- If the target has not been analyzed yet, as will happen with - -- delayed expansion, use the given type (either the aggregate - -- type or an ancestor) to determine limitedness. + -- delayed expansion, use the given type (either the aggregate type + -- or an ancestor) to determine limitedness. if No (Target_Type) then Target_Type := Typ; @@ -2214,8 +2213,8 @@ package body Exp_Aggr is Outer_Typ := Etype (Outer_Typ); end loop; - -- Attach it to the outer record controller to the - -- external final list + -- Attach it to the outer record controller to the external + -- final list. if Outer_Typ = Init_Typ then Append_List_To (L, @@ -2322,9 +2321,9 @@ package body Exp_Aggr is end Gen_Ctrl_Actions_For_Aggr; function Replace_Type (Expr : Node_Id) return Traverse_Result; - -- If the aggregate contains a self-reference, traverse each - -- expression to replace a possible self-reference with a reference - -- to the proper component of the target of the assignment. + -- If the aggregate contains a self-reference, traverse each expression + -- to replace a possible self-reference with a reference to the proper + -- component of the target of the assignment. ------------------ -- Replace_Type -- @@ -2332,9 +2331,19 @@ package body Exp_Aggr is function Replace_Type (Expr : Node_Id) return Traverse_Result is begin + -- Note regarding the Root_Type test below: Aggregate components for + -- self-referential types include attribute references to the current + -- instance, of the form: Typ'access, etc.. These references are + -- rewritten as references to the target of the aggregate: the + -- left-hand side of an assignment, the entity in a declaration, + -- or a temporary. Without this test, we would improperly extended + -- this rewriting to attribute references whose prefix was not the + -- type of the aggregate. + if Nkind (Expr) = N_Attribute_Reference - and then Is_Entity_Name (Prefix (Expr)) + and then Is_Entity_Name (Prefix (Expr)) and then Is_Type (Entity (Prefix (Expr))) + and then Root_Type (Etype (N)) = Root_Type (Entity (Prefix (Expr))) then if Is_Entity_Name (Lhs) then Rewrite (Prefix (Expr), @@ -2394,7 +2403,7 @@ package body Exp_Aggr is -- init-proc (T(tmp)); if T is constrained and -- init-proc (S(tmp)); where S applies an appropriate - -- constraint if T is unconstrained + -- constraint if T is unconstrained if Is_Entity_Name (A) and then Is_Type (Entity (A)) then Ancestor_Is_Subtype_Mark := True; @@ -2533,7 +2542,7 @@ package body Exp_Aggr is -- Make the assignment without usual controlled actions since -- we only want the post adjust but not the pre finalize here - -- Add manual adjust when necessary + -- Add manual adjust when necessary. Assign := New_List ( Make_OK_Assignment_Statement (Loc, diff --git a/gcc/ada/exp_atag.adb b/gcc/ada/exp_atag.adb index 670ddf8b868..c2c37a7eb30 100644 --- a/gcc/ada/exp_atag.adb +++ b/gcc/ada/exp_atag.adb @@ -369,64 +369,32 @@ package body Exp_Atag is New_Tag_Node : Node_Id) return Node_Id is begin - if RTE_Available (RE_DT) then - return - Make_Assignment_Statement (Loc, - Name => - Make_Slice (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr), - Make_Selected_Component (Loc, - Prefix => - Build_DT (Loc, New_Tag_Node), - Selector_Name => - New_Reference_To - (RTE_Record_Component (RE_Predef_Prims), Loc)))), - Discrete_Range => Make_Range (Loc, - Make_Integer_Literal (Loc, Uint_1), - New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))), - - Expression => - Make_Slice (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr), - Make_Selected_Component (Loc, - Prefix => - Build_DT (Loc, Old_Tag_Node), - Selector_Name => - New_Reference_To - (RTE_Record_Component (RE_Predef_Prims), Loc)))), - - Discrete_Range => - Make_Range (Loc, - Low_Bound => Make_Integer_Literal (Loc, 1), - High_Bound => - New_Reference_To (RTE (RE_Max_Predef_Prims), Loc)))); - else - return - Make_Assignment_Statement (Loc, - Name => - Make_Slice (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Build_Predef_Prims (Loc, New_Tag_Node)), - Discrete_Range => Make_Range (Loc, - Make_Integer_Literal (Loc, Uint_1), - New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))), + return + Make_Assignment_Statement (Loc, + Name => + Make_Slice (Loc, + Prefix => + Make_Explicit_Dereference (Loc, + Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr), + Make_Explicit_Dereference (Loc, + Unchecked_Convert_To (RTE (RE_Addr_Ptr), + New_Tag_Node)))), + Discrete_Range => Make_Range (Loc, + Make_Integer_Literal (Loc, Uint_1), + New_Reference_To (RTE (RE_Max_Predef_Prims), Loc))), - Expression => - Make_Slice (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Build_Predef_Prims (Loc, Old_Tag_Node)), - Discrete_Range => - Make_Range (Loc, - Low_Bound => Make_Integer_Literal (Loc, 1), - High_Bound => - New_Reference_To (RTE (RE_Max_Predef_Prims), Loc)))); - end if; + Expression => + Make_Slice (Loc, + Prefix => + Make_Explicit_Dereference (Loc, + Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr), + Make_Explicit_Dereference (Loc, + Unchecked_Convert_To (RTE (RE_Addr_Ptr), + Old_Tag_Node)))), + Discrete_Range => + Make_Range (Loc, + Make_Integer_Literal (Loc, 1), + New_Reference_To (RTE (RE_Max_Predef_Prims), Loc)))); end Build_Inherit_Predefined_Prims; ------------------------ @@ -472,8 +440,15 @@ package body Exp_Atag is begin return Make_Assignment_Statement (Loc, - Name => Build_Get_Predefined_Prim_Op_Address (Loc, - Tag_Node, Position), + Name => + Make_Indexed_Component (Loc, + Prefix => + Unchecked_Convert_To (RTE (RE_Predef_Prims_Table_Ptr), + Make_Explicit_Dereference (Loc, + Unchecked_Convert_To (RTE (RE_Addr_Ptr), Tag_Node))), + Expressions => + New_List (Make_Integer_Literal (Loc, Position))), + Expression => Address_Node); end Build_Set_Predefined_Prim_Op_Address; diff --git a/gcc/ada/exp_atag.ads b/gcc/ada/exp_atag.ads index 5f22431062b..9d724f29140 100644 --- a/gcc/ada/exp_atag.ads +++ b/gcc/ada/exp_atag.ads @@ -90,15 +90,16 @@ package Exp_Atag is -- Generates: TSD (Tag).Transportable; function Build_Inherit_Predefined_Prims - (Loc : Source_Ptr; - Old_Tag_Node : Node_Id; - New_Tag_Node : Node_Id) return Node_Id; + (Loc : Source_Ptr; + Old_Tag_Node : Node_Id; + New_Tag_Node : Node_Id) return Node_Id; -- Build code that inherits the predefined primitives of the parent. -- -- Generates: Predefined_DT (New_T).D (All_Predefined_Prims) := -- Predefined_DT (Old_T).D (All_Predefined_Prims); -- - -- Required to build the dispatch tables with the 3.4 backend. + -- Required to build non-library level dispatch tables. Also required + -- when compiling without static dispatch tables support. function Build_Inherit_Prims (Loc : Source_Ptr; diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index b7c7d1d5603..a5ff0011a6f 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -49,6 +49,7 @@ with Restrict; use Restrict; with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; +with Sem_Ch6; use Sem_Ch6; with Sem_Ch7; use Sem_Ch7; with Sem_Ch8; use Sem_Ch8; with Sem_Eval; use Sem_Eval; @@ -611,6 +612,121 @@ package body Exp_Attr is Ref_Object : constant Node_Id := Get_Referenced_Object (Pref); begin + -- In order to improve the text of error messages, the designated + -- type of access-to-subprogram itypes is set by the semantics as + -- the associated subprogram entity (see sem_attr). Now we replace + -- such node with the proper E_Subprogram_Type itype. + + if Id = Attribute_Unrestricted_Access + and then Is_Subprogram (Directly_Designated_Type (Typ)) + then + -- The following assertion ensures that this special management + -- is done only for "Address!(Prim'Unrestricted_Access)" nodes. + -- At this stage other cases in which the designated type is + -- still a subprogram (instead of an E_Subprogram_Type) are + -- wrong because the semantics must have overriden the type of + -- the node with the type imposed by the context. + + pragma Assert (Nkind (Parent (N)) = N_Unchecked_Type_Conversion + and then Etype (Parent (N)) = RTE (RE_Address)); + + declare + Subp : constant Entity_Id := Directly_Designated_Type (Typ); + + Extra : Entity_Id := Empty; + New_Formal : Entity_Id; + Old_Formal : Entity_Id := First_Formal (Subp); + Subp_Typ : Entity_Id; + + begin + Subp_Typ := Create_Itype (E_Subprogram_Type, N); + Set_Etype (Subp_Typ, Etype (Subp)); + Set_Returns_By_Ref (Subp_Typ, Returns_By_Ref (Subp)); + + if Present (Old_Formal) then + New_Formal := New_Copy (Old_Formal); + Set_First_Entity (Subp_Typ, New_Formal); + + loop + Set_Scope (New_Formal, Subp_Typ); + + -- Handle itypes + + if Is_Itype (Etype (New_Formal)) then + Extra := New_Copy (Etype (New_Formal)); + + if Ekind (Extra) = E_Record_Subtype + or else Ekind (Extra) = E_Class_Wide_Subtype + then + Set_Cloned_Subtype (Extra, + Etype (New_Formal)); + end if; + + Set_Etype (New_Formal, Extra); + Set_Scope (Etype (New_Formal), Subp_Typ); + end if; + + Extra := New_Formal; + Next_Formal (Old_Formal); + exit when No (Old_Formal); + + Set_Next_Entity (New_Formal, + New_Copy (Old_Formal)); + Next_Entity (New_Formal); + end loop; + + Set_Next_Entity (New_Formal, Empty); + Set_Last_Entity (Subp_Typ, Extra); + end if; + + -- Now that the explicit formals have been duplicated, + -- any extra formals needed by the subprogram must be + -- created. + + if Present (Extra) then + Set_Extra_Formal (Extra, Empty); + end if; + + Create_Extra_Formals (Subp_Typ); + Set_Directly_Designated_Type (Typ, Subp_Typ); + + -- Complete decoration of access-to-subprogram itype to + -- indicate to the backend that this itype corresponds to + -- a statically allocated dispatch table. + + -- ??? more comments on structure here, three level parent + -- references are worrisome! + + if Nkind (Ref_Object) in N_Has_Entity + and then Is_Dispatching_Operation (Entity (Ref_Object)) + and then Present (Parent (Parent (N))) + and then Nkind (Parent (Parent (N))) = N_Aggregate + and then Present (Parent (Parent (Parent (N)))) + then + declare + P : constant Node_Id := + Parent (Parent (Parent (N))); + Prim : constant Entity_Id := Entity (Ref_Object); + + begin + Set_Is_Static_Dispatch_Table_Entity (Typ, + (Is_Predefined_Dispatching_Operation (Prim) + and then Nkind (P) = N_Object_Declaration + and then Is_Static_Dispatch_Table_Entity + (Defining_Identifier (P))) + or else + (not Is_Predefined_Dispatching_Operation (Prim) + and then Nkind (P) = N_Aggregate + and then Present (Parent (P)) + and then Nkind (Parent (P)) + = N_Object_Declaration + and then Is_Static_Dispatch_Table_Entity + (Defining_Identifier (Parent (P))))); + end; + end if; + end; + end if; + if Is_Access_Protected_Subprogram_Type (Btyp) then Expand_Access_To_Protected_Op (N, Pref, Typ); @@ -1208,18 +1324,20 @@ package body Exp_Attr is -- Protected case if Is_Protected_Type (Conctype) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Conctype) > 1 - then - Name := - New_Reference_To - (RTE (RE_Protected_Entry_Caller), Loc); - else - Name := - New_Reference_To - (RTE (RE_Protected_Single_Entry_Caller), Loc); - end if; + case Corresponding_Runtime_Package (Conctype) is + when System_Tasking_Protected_Objects_Entries => + Name := + New_Reference_To + (RTE (RE_Protected_Entry_Caller), Loc); + + when System_Tasking_Protected_Objects_Single_Entry => + Name := + New_Reference_To + (RTE (RE_Protected_Single_Entry_Caller), Loc); + + when others => + raise Program_Error; + end case; Rewrite (N, Unchecked_Convert_To (Id_Kind, @@ -1488,31 +1606,35 @@ package body Exp_Attr is if Is_Protected_Type (Conctyp) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Conctyp) > 1 - then - Name := New_Reference_To (RTE (RE_Protected_Count), Loc); - - Call := - Make_Function_Call (Loc, - Name => Name, - Parameter_Associations => New_List ( - New_Reference_To ( - Object_Ref ( - Corresponding_Body (Parent (Conctyp))), Loc), - Entry_Index_Expression ( - Loc, Entity (Entnam), Index, Scope (Entity (Entnam))))); - else - Name := New_Reference_To (RTE (RE_Protected_Count_Entry), Loc); - - Call := Make_Function_Call (Loc, - Name => Name, - Parameter_Associations => New_List ( - New_Reference_To ( - Object_Ref ( - Corresponding_Body (Parent (Conctyp))), Loc))); - end if; + case Corresponding_Runtime_Package (Conctyp) is + when System_Tasking_Protected_Objects_Entries => + Name := New_Reference_To (RTE (RE_Protected_Count), Loc); + + Call := + Make_Function_Call (Loc, + Name => Name, + Parameter_Associations => New_List ( + New_Reference_To ( + Object_Ref ( + Corresponding_Body (Parent (Conctyp))), Loc), + Entry_Index_Expression (Loc, + Entity (Entnam), Index, Scope (Entity (Entnam))))); + + when System_Tasking_Protected_Objects_Single_Entry => + Name := New_Reference_To + (RTE (RE_Protected_Count_Entry), Loc); + + Call := + Make_Function_Call (Loc, + Name => Name, + Parameter_Associations => New_List ( + New_Reference_To ( + Object_Ref ( + Corresponding_Body (Parent (Conctyp))), Loc))); + when others => + raise Program_Error; + + end case; -- Task case @@ -2726,6 +2848,41 @@ package body Exp_Attr is -- The processing for Object_Size shares the processing for Size + --------- + -- Old -- + --------- + + when Attribute_Old => Old : declare + Tnn : constant Entity_Id := + Make_Defining_Identifier (Loc, + Chars => New_Internal_Name ('T')); + Subp : Node_Id; + Asn_Stm : Node_Id; + + begin + Subp := N; + loop + Subp := Parent (Subp); + exit when Nkind (Subp) = N_Subprogram_Body; + end loop; + + Asn_Stm := + Make_Object_Declaration (Loc, + Defining_Identifier => Tnn, + Constant_Present => True, + Object_Definition => New_Occurrence_Of (Etype (N), Loc), + Expression => Pref); + + if Is_Empty_List (Declarations (Subp)) then + Set_Declarations (Subp, New_List (Asn_Stm)); + Analyze (Asn_Stm); + else + Insert_Action (First (Declarations (Subp)), Asn_Stm); + end if; + + Rewrite (N, New_Occurrence_Of (Tnn, Loc)); + end Old; + ------------ -- Output -- ------------ @@ -5177,8 +5334,9 @@ package body Exp_Attr is N := First_Rep_Item (Implementation_Base_Type (T)); while Present (N) loop - if Nkind (N) = N_Pragma and then Chars (N) = Name_Stream_Convert then - + if Nkind (N) = N_Pragma + and then Pragma_Name (N) = Name_Stream_Convert + then -- For tagged types this pragma is not inherited, so we -- must verify that it is defined for the given type and -- not an ancestor. diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index ad4cad14adc..dbe3ebe73ad 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -143,12 +143,21 @@ package body Exp_Ch11 is Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Clean, Loc))); - -- Avoid generation of raise stmt if compiling with no exceptions - -- propagation + -- Generate reraise statement as last statement of AT-END handler, + -- unless we are under control of No_Exception_Propagation, in which + -- case no exception propagation is possible anyway, so we do not need + -- a reraise (the AT END handler in this case is only for normal exits + -- not for exceptional exits). Also, we flag the Reraise statement as + -- being part of an AT END handler to prevent signalling this reraise + -- as a violation of the restriction when it is not set. if not Restriction_Active (No_Exception_Propagation) then - Append_To (Stmnts, - Make_Raise_Statement (Loc)); + declare + Rstm : constant Node_Id := Make_Raise_Statement (Loc); + begin + Set_From_At_End (Rstm); + Append_To (Stmnts, Rstm); + end; end if; Set_Exception_Handlers (HSS, New_List ( @@ -963,7 +972,7 @@ package body Exp_Ch11 is Handler_Loop : while Present (Handler) loop Next_Handler := Next_Non_Pragma (Handler); - -- Remove source handler if gnat debug flag N is set + -- Remove source handler if gnat debug flag .x is set if Debug_Flag_Dot_X and then Comes_From_Source (Handler) then Remove (Handler); @@ -971,8 +980,9 @@ package body Exp_Ch11 is -- Remove handler if no exception propagation, generating a warning -- if a source generated handler was not the target of a local raise. - elsif Restriction_Active (No_Exception_Propagation) then - if not Has_Local_Raise (Handler) + else + if Restriction_Active (No_Exception_Propagation) + and then not Has_Local_Raise (Handler) and then Comes_From_Source (Handler) and then Warn_On_Non_Local_Exception then @@ -982,118 +992,124 @@ package body Exp_Ch11 is Handler); end if; - Remove (Handler); - - -- Exception handler is active and retained and must be processed - - else - -- If an exception occurrence is present, then we must declare it - -- and initialize it from the value stored in the TSD - - -- declare - -- name : Exception_Occurrence; - -- begin - -- Save_Occurrence (name, Get_Current_Excep.all) - -- ... - -- end; - - if Present (Choice_Parameter (Handler)) then - declare - Cparm : constant Entity_Id := Choice_Parameter (Handler); - Clc : constant Source_Ptr := Sloc (Cparm); - Save : Node_Id; - - begin - Save := - Make_Procedure_Call_Statement (Loc, - Name => - New_Occurrence_Of (RTE (RE_Save_Occurrence), Loc), - Parameter_Associations => New_List ( - New_Occurrence_Of (Cparm, Clc), - Make_Explicit_Dereference (Loc, - Make_Function_Call (Loc, - Name => Make_Explicit_Dereference (Loc, - New_Occurrence_Of - (RTE (RE_Get_Current_Excep), Loc)))))); - - Mark_Rewrite_Insertion (Save); - Prepend (Save, Statements (Handler)); - - Obj_Decl := - Make_Object_Declaration - (Clc, - Defining_Identifier => Cparm, - Object_Definition => - New_Occurrence_Of - (RTE (RE_Exception_Occurrence), Clc)); - Set_No_Initialization (Obj_Decl, True); - - Rewrite (Handler, - Make_Implicit_Exception_Handler (Loc, - Exception_Choices => Exception_Choices (Handler), - - Statements => New_List ( - Make_Block_Statement (Loc, - Declarations => New_List (Obj_Decl), - Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, - Statements => Statements (Handler)))))); - - Analyze_List (Statements (Handler), Suppress => All_Checks); - end; - end if; - - -- The processing at this point is rather different for the JVM - -- case, so we completely separate the processing. + if No_Exception_Propagation_Active then + Remove (Handler); - -- For the JVM case, we unconditionally call Update_Exception, - -- passing a call to the intrinsic Current_Target_Exception (see - -- JVM version of Ada.Exceptions in 4jexcept.adb for details). + -- Exception handler is active and retained and must be processed - if VM_Target /= No_VM then - declare - Arg : constant Node_Id := - Make_Function_Call (Loc, - Name => - New_Occurrence_Of - (RTE (RE_Current_Target_Exception), Loc)); - begin - Prepend_Call_To_Handler - (RE_Update_Exception, New_List (Arg)); - end; + else + -- If an exception occurrence is present, then we must declare + -- it and initialize it from the value stored in the TSD - -- For the normal case, we have to worry about the state of - -- abort deferral. Generally, we defer abort during runtime - -- handling of exceptions. When control is passed to the - -- handler, then in the normal case we undefer aborts. In any - -- case this entire handling is relevant only if aborts are - -- allowed! + -- declare + -- name : Exception_Occurrence; + -- begin + -- Save_Occurrence (name, Get_Current_Excep.all) + -- ... + -- end; - elsif Abort_Allowed then + if Present (Choice_Parameter (Handler)) then + declare + Cparm : constant Entity_Id := Choice_Parameter (Handler); + Clc : constant Source_Ptr := Sloc (Cparm); + Save : Node_Id; - -- There are some special cases in which we do not do the - -- undefer. In particular a finalization (AT END) handler - -- wants to operate with aborts still deferred. + begin + Save := + Make_Procedure_Call_Statement (Loc, + Name => + New_Occurrence_Of (RTE (RE_Save_Occurrence), Loc), + Parameter_Associations => New_List ( + New_Occurrence_Of (Cparm, Clc), + Make_Explicit_Dereference (Loc, + Make_Function_Call (Loc, + Name => Make_Explicit_Dereference (Loc, + New_Occurrence_Of + (RTE (RE_Get_Current_Excep), Loc)))))); + + Mark_Rewrite_Insertion (Save); + Prepend (Save, Statements (Handler)); + + Obj_Decl := + Make_Object_Declaration + (Clc, + Defining_Identifier => Cparm, + Object_Definition => + New_Occurrence_Of + (RTE (RE_Exception_Occurrence), Clc)); + Set_No_Initialization (Obj_Decl, True); + + Rewrite (Handler, + Make_Implicit_Exception_Handler (Loc, + Exception_Choices => Exception_Choices (Handler), + + Statements => New_List ( + Make_Block_Statement (Loc, + Declarations => New_List (Obj_Decl), + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, + Statements => Statements (Handler)))))); + + Analyze_List + (Statements (Handler), Suppress => All_Checks); + end; + end if; - -- We also suppress the call if this is the special handler - -- for Abort_Signal, since if we are aborting, we want to keep - -- aborts deferred (one abort is enough). + -- The processing at this point is rather different for the JVM + -- case, so we completely separate the processing. - -- If abort really needs to be deferred the expander must add - -- this call explicitly, see Expand_N_Asynchronous_Select. + -- For the VM case, we unconditionally call Update_Exception, + -- passing a call to the intrinsic Current_Target_Exception + -- (see JVM/.NET versions of Ada.Exceptions for details). - Others_Choice := - Nkind (First (Exception_Choices (Handler))) = N_Others_Choice; + if VM_Target /= No_VM then + declare + Arg : constant Node_Id := + Make_Function_Call (Loc, + Name => + New_Occurrence_Of + (RTE (RE_Current_Target_Exception), Loc)); + begin + Prepend_Call_To_Handler + (RE_Update_Exception, New_List (Arg)); + end; - if (Others_Choice - or else Entity (First (Exception_Choices (Handler))) /= - Stand.Abort_Signal) - and then not - (Others_Choice - and then All_Others (First (Exception_Choices (Handler)))) - and then Abort_Allowed - then - Prepend_Call_To_Handler (RE_Abort_Undefer); + -- For the normal case, we have to worry about the state of + -- abort deferral. Generally, we defer abort during runtime + -- handling of exceptions. When control is passed to the + -- handler, then in the normal case we undefer aborts. In + -- any case this entire handling is relevant only if aborts + -- are allowed! + + elsif Abort_Allowed then + + -- There are some special cases in which we do not do the + -- undefer. In particular a finalization (AT END) handler + -- wants to operate with aborts still deferred. + + -- We also suppress the call if this is the special handler + -- for Abort_Signal, since if we are aborting, we want to + -- keep aborts deferred (one abort is enough). + + -- If abort really needs to be deferred the expander must + -- add this call explicitly, see + -- Expand_N_Asynchronous_Select. + + Others_Choice := + Nkind (First (Exception_Choices (Handler))) = + N_Others_Choice; + + if (Others_Choice + or else Entity (First (Exception_Choices (Handler))) /= + Stand.Abort_Signal) + and then not + (Others_Choice + and then + All_Others (First (Exception_Choices (Handler)))) + and then Abort_Allowed + then + Prepend_Call_To_Handler (RE_Abort_Undefer); + end if; end if; end if; end if; @@ -1248,7 +1264,6 @@ package body Exp_Ch11 is Insert_List_After_And_Analyze (N, L); end if; end if; - end Expand_N_Exception_Declaration; --------------------------------------------- @@ -1334,8 +1349,6 @@ package body Exp_Ch11 is H : Node_Id; begin - -- Debug_Flag_Dot_G := True; - -- Processing for locally handled exception (exclude reraise case) if Present (Name (N)) and then Nkind (Name (N)) = N_Identifier then diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index 9c39c1c4a83..11b3fef8861 100644 --- a/gcc/ada/exp_ch13.adb +++ b/gcc/ada/exp_ch13.adb @@ -212,13 +212,19 @@ package body Exp_Ch13 is -- expanded away. The same is true for entities in task types, in -- particular the parameter records of entries (Entities in bodies are -- all frozen within the body). If we are in the task body, this is a - -- proper scope. + -- proper scope. If we are within a subprogram body, the proper scope + -- is the corresponding spec. This may happen for itypes generated in + -- the bodies of protected operations. if Ekind (E_Scope) = E_Protected_Type or else (Ekind (E_Scope) = E_Task_Type and then not Has_Completion (E_Scope)) then E_Scope := Scope (E_Scope); + + elsif Ekind (E_Scope) = E_Subprogram_Body then + E_Scope := Corresponding_Spec (Unit_Declaration_Node (E_Scope)); + end if; S := Current_Scope; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index dbec81fb505..0473fc0fb68 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -4451,18 +4451,10 @@ package body Exp_Ch4 is if Max_Available_String_Operands < 1 then - -- In No_Run_Time mode, consider that no entities are available + -- See what routines are available and set max operand count + -- according to the highest count available in the run-time. - -- This seems wrong, RTE_Available should return False for any entity - -- that is not in the special No_Run_Time list of allowed entities??? - - if No_Run_Time_Mode then - Max_Available_String_Operands := 0; - - -- Otherwise see what routines are available and set max operand - -- count according to the highest count available in the run-time. - - elsif not RTE_Available (RE_Str_Concat) then + if not RTE_Available (RE_Str_Concat) then Max_Available_String_Operands := 0; elsif not RTE_Available (RE_Str_Concat_3) then @@ -4479,8 +4471,6 @@ package body Exp_Ch4 is end if; Char_Concat_Available := - not No_Run_Time_Mode - and then RTE_Available (RE_Str_Concat_CC) and then RTE_Available (RE_Str_Concat_CS) @@ -8850,8 +8840,8 @@ package body Exp_Ch4 is and then Comes_From_Source (Original_Node (N)) and then Nkind (Original_Node (N)) = N_Op_Ge and then not In_Instance - and then not Warnings_Off (Etype (Left_Opnd (N))) and then Is_Integer_Type (Etype (Left_Opnd (N))) + and then not Has_Warnings_Off (Etype (Left_Opnd (N))) then Error_Msg_N ("can never be greater than, could replace by ""'=""?", N); @@ -8874,8 +8864,8 @@ package body Exp_Ch4 is and then Comes_From_Source (Original_Node (N)) and then Nkind (Original_Node (N)) = N_Op_Le and then not In_Instance - and then not Warnings_Off (Etype (Left_Opnd (N))) and then Is_Integer_Type (Etype (Left_Opnd (N))) + and then not Has_Warnings_Off (Etype (Left_Opnd (N))) then Error_Msg_N ("can never be less than, could replace by ""'=""?", N); diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index e8619a152d1..24e7a7f08a1 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2792,6 +2792,30 @@ package body Exp_Ch5 is SS_Allocator := New_Copy_Tree (Heap_Allocator); end if; + -- If the No_Allocators restriction is active, then only + -- an allocator for secondary stack allocation is needed. + + if Restriction_Active (No_Allocators) then + SS_Allocator := Heap_Allocator; + Heap_Allocator := Make_Null (Loc); + + -- Otherwise the heap allocator may be needed, so we + -- make another allocator for secondary stack allocation. + + else + SS_Allocator := New_Copy_Tree (Heap_Allocator); + + -- The heap allocator is marked Comes_From_Source + -- since it corresponds to an explicit user-written + -- allocator (that is, it will only be executed on + -- behalf of callers that call the function as + -- initialization for such an allocator). This + -- prevents errors when No_Implicit_Heap_Allocation + -- is in force. + + Set_Comes_From_Source (Heap_Allocator, True); + end if; + -- The allocator is returned on the secondary stack. We -- don't do this on VM targets, since the SS is not used. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 8d75049fbc7..c5f88c7a898 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -3388,7 +3388,7 @@ package body Exp_Ch6 is -- not be posting warnings on the inlined body so it is unneeded. elsif Nkind (N) = N_Pragma - and then Chars (N) = Name_Unreferenced + and then Pragma_Name (N) = Name_Unreferenced then Rewrite (N, Make_Null_Statement (Sloc (N))); return OK; @@ -4756,14 +4756,14 @@ package body Exp_Ch6 is return; end if; - -- Skip the first access-to-dispatch-table pointer since it leads - -- to the primary dispatch table. We are only concerned with the - -- secondary dispatch table pointers. Note that the access-to- - -- dispatch-table pointer corresponds to the first implemented - -- interface retrieved below. + -- Skip the first two access-to-dispatch-table pointers since they + -- leads to the primary dispatch table (predefined DT and user + -- defined DT). We are only concerned with the secondary dispatch + -- table pointers. Note that the access-to- dispatch-table pointer + -- corresponds to the first implemented interface retrieved below. Iface_DT_Ptr := - Next_Elmt (First_Elmt (Access_Disp_Table (Tagged_Typ))); + Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (Tagged_Typ)))); while Present (Iface_DT_Ptr) and then Ekind (Node (Iface_DT_Ptr)) = E_Constant @@ -4776,23 +4776,41 @@ package body Exp_Ch6 is Thunk_Code, Build_Set_Predefined_Prim_Op_Address (Loc, - Tag_Node => New_Reference_To (Node (Iface_DT_Ptr), Loc), + Tag_Node => + New_Reference_To (Node (Next_Elmt (Iface_DT_Ptr)), Loc), Position => DT_Position (Prim), Address_Node => - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Thunk_Id, Loc), - Attribute_Name => Name_Address)), + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Thunk_Id, Loc), + Attribute_Name => Name_Unrestricted_Access))), Build_Set_Predefined_Prim_Op_Address (Loc, - Tag_Node => New_Reference_To - (Node (Next_Elmt (Iface_DT_Ptr)), Loc), + Tag_Node => + New_Reference_To + (Node (Next_Elmt (Next_Elmt (Next_Elmt (Iface_DT_Ptr)))), + Loc), Position => DT_Position (Prim), Address_Node => - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim, Loc), - Attribute_Name => Name_Address)))); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim, Loc), + Attribute_Name => Name_Unrestricted_Access))))); end if; + -- Skip the tag of the predefined primitives dispatch table + + Next_Elmt (Iface_DT_Ptr); + pragma Assert (Has_Thunks (Node (Iface_DT_Ptr))); + + -- Skip the tag of the no-thunks dispatch table + + Next_Elmt (Iface_DT_Ptr); + pragma Assert (not Has_Thunks (Node (Iface_DT_Ptr))); + + -- Skip the tag of the predefined primitives no-thunks dispatch + -- table + Next_Elmt (Iface_DT_Ptr); pragma Assert (not Has_Thunks (Node (Iface_DT_Ptr))); diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index dff4ba0bf21..678f8441011 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2301,14 +2301,16 @@ package body Exp_Ch7 is if Nkind (Specification (N)) = N_Procedure_Specification and then Has_Entries (Pid) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Pid) > 1 - then - Name := New_Reference_To (RTE (RE_Service_Entries), Loc); - else - Name := New_Reference_To (RTE (RE_Service_Entry), Loc); - end if; + case Corresponding_Runtime_Package (Pid) is + when System_Tasking_Protected_Objects_Entries => + Name := New_Reference_To (RTE (RE_Service_Entries), Loc); + + when System_Tasking_Protected_Objects_Single_Entry => + Name := New_Reference_To (RTE (RE_Service_Entry), Loc); + + when others => + raise Program_Error; + end case; Append_To (Stmt, Make_Procedure_Call_Statement (Loc, @@ -2329,31 +2331,19 @@ package body Exp_Ch7 is -- object is the record used to implement the protected object. -- It is a parameter to the protected subprogram. - -- If the protected object is controlled (i.e it has entries or - -- needs finalization for interrupt handling), call - -- Unlock_Entries, except if the protected object follows the - -- ravenscar profile, in which case call Unlock_Entry, otherwise - -- call the simplified version, Unlock. - - if Has_Entries (Pid) - or else Has_Interrupt_Handler (Pid) - or else (Has_Attach_Handler (Pid) - and then not Restricted_Profile) - or else (Ada_Version >= Ada_05 - and then Present (Interface_List (Parent (Pid)))) - then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Pid) > 1 - then + case Corresponding_Runtime_Package (Pid) is + when System_Tasking_Protected_Objects_Entries => Name := New_Reference_To (RTE (RE_Unlock_Entries), Loc); - else + + when System_Tasking_Protected_Objects_Single_Entry => Name := New_Reference_To (RTE (RE_Unlock_Entry), Loc); - end if; - else - Name := New_Reference_To (RTE (RE_Unlock), Loc); - end if; + when System_Tasking_Protected_Objects => + Name := New_Reference_To (RTE (RE_Unlock), Loc); + + when others => + raise Program_Error; + end case; Append_To (Stmt, Make_Procedure_Call_Statement (Loc, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 6e0d309a1ab..2fa47520947 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -666,7 +666,7 @@ package body Exp_Ch9 is Expression => Unchecked_Convert_To (Obj_Ptr, Make_Identifier (Loc, Name_uO))); - Set_Needs_Debug_Info (Defining_Identifier (Decl)); + Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (Decls, Decl); Prepend_To (Decls, @@ -703,10 +703,16 @@ package body Exp_Ch9 is while Present (Formal) loop Comp := Entry_Component (Formal); New_F := - Make_Defining_Identifier (Sloc (Formal), Chars (Formal)); + Make_Defining_Identifier (Sloc (Formal), + Chars => Chars (Formal)); Set_Etype (New_F, Etype (Formal)); Set_Scope (New_F, Ent); - Set_Needs_Debug_Info (New_F); -- That's the whole point. + + -- Now we set debug info needed on New_F even though it does not + -- come from source, so that the debugger will get the right + -- information for these generated names. + + Set_Debug_Info_Needed (New_F); if Ekind (Formal) = E_In_Parameter then Set_Ekind (New_F, E_Constant); @@ -779,7 +785,7 @@ package body Exp_Ch9 is Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Name), Selector_Name => Make_Identifier (Loc, Chars (Pdef)))); - Set_Needs_Debug_Info (Defining_Identifier (Decl)); + Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (Decls, Decl); end if; @@ -793,6 +799,8 @@ package body Exp_Ch9 is Protection_Type : RE_Id; begin + -- Could this be simplified using Corresponding_Runtime_Package??? + if Has_Attach_Handler (Typ) then if Restricted_Profile then if Has_Entries (Typ) then @@ -814,14 +822,16 @@ package body Exp_Ch9 is or else (Ada_Version >= Ada_05 and then Present (Interface_List (Parent (Typ)))) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Typ) > 1 - then - Protection_Type := RE_Protection_Entries; - else - Protection_Type := RE_Protection_Entry; - end if; + case Corresponding_Runtime_Package (Typ) is + when System_Tasking_Protected_Objects_Entries => + Protection_Type := RE_Protection_Entries; + + when System_Tasking_Protected_Objects_Single_Entry => + Protection_Type := RE_Protection_Entry; + + when others => + raise Program_Error; + end case; else Protection_Type := RE_Protection; @@ -839,7 +849,7 @@ package body Exp_Ch9 is Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Name), Selector_Name => Make_Identifier (Loc, Name_uObject))); - Set_Needs_Debug_Info (Defining_Identifier (Decl)); + Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (Decls, Decl); end; end Add_Private_Declarations; @@ -1080,7 +1090,7 @@ package body Exp_Ch9 is Loc : Source_Ptr) return Node_Id is begin - Set_Needs_Debug_Info (Def_Id); + Set_Debug_Info_Needed (Def_Id); return Make_Function_Specification (Loc, Defining_Unit_Name => Def_Id, Parameter_Specifications => New_List ( @@ -2147,16 +2157,18 @@ package body Exp_Ch9 is Add_Formal_Renamings (Espec, Op_Decls, Ent, Loc); - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Pid) > 1 - or else (Has_Attach_Handler (Pid) and then not Restricted_Profile) - then - Complete := New_Reference_To (RTE (RE_Complete_Entry_Body), Loc); - else - Complete := - New_Reference_To (RTE (RE_Complete_Single_Entry_Body), Loc); - end if; + case Corresponding_Runtime_Package (Pid) is + when System_Tasking_Protected_Objects_Entries => + Complete := + New_Reference_To (RTE (RE_Complete_Entry_Body), Loc); + + when System_Tasking_Protected_Objects_Single_Entry => + Complete := + New_Reference_To (RTE (RE_Complete_Single_Entry_Body), Loc); + + when others => + raise Program_Error; + end case; Op_Stats := New_List ( Make_Block_Statement (Loc, @@ -2194,18 +2206,20 @@ package body Exp_Ch9 is Ohandle := Make_Others_Choice (Loc); Set_All_Others (Ohandle); - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Pid) > 1 - or else (Has_Attach_Handler (Pid) and then not Restricted_Profile) - then - Complete := - New_Reference_To (RTE (RE_Exceptional_Complete_Entry_Body), Loc); + case Corresponding_Runtime_Package (Pid) is + when System_Tasking_Protected_Objects_Entries => + Complete := + New_Reference_To + (RTE (RE_Exceptional_Complete_Entry_Body), Loc); - else - Complete := New_Reference_To ( - RTE (RE_Exceptional_Complete_Single_Entry_Body), Loc); - end if; + when System_Tasking_Protected_Objects_Single_Entry => + Complete := + New_Reference_To + (RTE (RE_Exceptional_Complete_Single_Entry_Body), Loc); + + when others => + raise Program_Error; + end case; -- Create body of entry procedure. The renaming declarations are -- placed ahead of the block that contains the actual entry body. @@ -2253,7 +2267,7 @@ package body Exp_Ch9 is P : Entity_Id; begin - Set_Needs_Debug_Info (Def_Id); + Set_Debug_Info_Needed (Def_Id); P := Make_Defining_Identifier (Loc, Name_uP); if Present (Ent_Id) then @@ -2329,7 +2343,7 @@ package body Exp_Ch9 is (Etype (Ident) = Standard_Void_Type and then not Is_RTE (Obj_Type, RE_Address)), Parameter_Type => New_Reference_To (Obj_Type, Loc)); - Set_Needs_Debug_Info (Defining_Identifier (Decl)); + Set_Debug_Info_Needed (Defining_Identifier (Decl)); Prepend_To (New_Plist, Decl); return New_Plist; @@ -2382,7 +2396,7 @@ package body Exp_Ch9 is -- into the protected operation, even though it only contains lock/ -- unlock calls. - Set_Needs_Debug_Info (New_Id); + Set_Debug_Info_Needed (New_Id); if Nkind (Specification (Decl)) = N_Procedure_Specification then return @@ -2596,36 +2610,22 @@ package body Exp_Ch9 is -- Make the protected subprogram body. This locks the protected -- object and calls the unprotected version of the subprogram. - -- If the protected object is controlled (i.e it has entries or - -- needs finalization for interrupt handling), call Lock_Entries, - -- except if the protected object follows the Ravenscar profile, in - -- which case call Lock_Entry, otherwise call the simplified version, - -- Lock. - - if Has_Entries (Pid) - or else Has_Interrupt_Handler (Pid) - or else (Has_Attach_Handler (Pid) - and then not Restricted_Profile) - or else (Ada_Version >= Ada_05 - and then Present (Interface_List (Parent (Pid)))) - then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Pid) > 1 - or else (Has_Attach_Handler (Pid) and then not Restricted_Profile) - then + case Corresponding_Runtime_Package (Pid) is + when System_Tasking_Protected_Objects_Entries => Lock_Name := New_Reference_To (RTE (RE_Lock_Entries), Loc); Service_Name := New_Reference_To (RTE (RE_Service_Entries), Loc); - else + when System_Tasking_Protected_Objects_Single_Entry => Lock_Name := New_Reference_To (RTE (RE_Lock_Entry), Loc); Service_Name := New_Reference_To (RTE (RE_Service_Entry), Loc); - end if; - else - Lock_Name := New_Reference_To (RTE (RE_Lock), Loc); - Service_Name := New_Reference_To (RTE (RE_Unlock), Loc); - end if; + when System_Tasking_Protected_Objects => + Lock_Name := New_Reference_To (RTE (RE_Lock), Loc); + Service_Name := New_Reference_To (RTE (RE_Unlock), Loc); + + when others => + raise Program_Error; + end case; Object_Parm := Make_Attribute_Reference (Loc, @@ -3101,75 +3101,75 @@ package body Exp_Ch9 is -- Now we can create the call, case of protected type if Is_Protected_Type (Conctyp) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Conctyp) > 1 - or else (Has_Attach_Handler (Conctyp) - and then not Restricted_Profile) - then - -- Change the type of the index declaration - - Set_Object_Definition (Xdecl, - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc)); + case Corresponding_Runtime_Package (Conctyp) is + when System_Tasking_Protected_Objects_Entries => - -- Some additional declarations for protected entry calls + -- Change the type of the index declaration - if No (Decls) then - Decls := New_List; - end if; + Set_Object_Definition (Xdecl, + New_Reference_To (RTE (RE_Protected_Entry_Index), Loc)); - -- Bnn : Communications_Block; + -- Some additional declarations for protected entry calls - Comm_Name := - Make_Defining_Identifier (Loc, New_Internal_Name ('B')); + if No (Decls) then + Decls := New_List; + end if; - Append_To (Decls, - Make_Object_Declaration (Loc, - Defining_Identifier => Comm_Name, - Object_Definition => - New_Reference_To (RTE (RE_Communication_Block), Loc))); + -- Bnn : Communications_Block; - -- Some additional statements for protected entry calls + Comm_Name := + Make_Defining_Identifier (Loc, New_Internal_Name ('B')); - -- Protected_Entry_Call ( - -- Object => po._object'Access, - -- E => <entry index>; - -- Uninterpreted_Data => P'Address; - -- Mode => Simple_Call; - -- Block => Bnn); + Append_To (Decls, + Make_Object_Declaration (Loc, + Defining_Identifier => Comm_Name, + Object_Definition => + New_Reference_To (RTE (RE_Communication_Block), Loc))); - Call := - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), + -- Some additional statements for protected entry calls - Parameter_Associations => New_List ( - Make_Attribute_Reference (Loc, - Attribute_Name => Name_Unchecked_Access, - Prefix => Parm1), - Parm2, - Parm3, - New_Reference_To (RTE (RE_Simple_Call), Loc), - New_Occurrence_Of (Comm_Name, Loc))); + -- Protected_Entry_Call ( + -- Object => po._object'Access, + -- E => <entry index>; + -- Uninterpreted_Data => P'Address; + -- Mode => Simple_Call; + -- Block => Bnn); - else - -- Protected_Single_Entry_Call ( - -- Object => po._object'Access, - -- Uninterpreted_Data => P'Address; - -- Mode => Simple_Call); + Call := + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), - Call := - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - RTE (RE_Protected_Single_Entry_Call), Loc), + Parameter_Associations => New_List ( + Make_Attribute_Reference (Loc, + Attribute_Name => Name_Unchecked_Access, + Prefix => Parm1), + Parm2, + Parm3, + New_Reference_To (RTE (RE_Simple_Call), Loc), + New_Occurrence_Of (Comm_Name, Loc))); + + when System_Tasking_Protected_Objects_Single_Entry => + -- Protected_Single_Entry_Call ( + -- Object => po._object'Access, + -- Uninterpreted_Data => P'Address; + -- Mode => Simple_Call); + + Call := + Make_Procedure_Call_Statement (Loc, + Name => New_Reference_To ( + RTE (RE_Protected_Single_Entry_Call), Loc), + + Parameter_Associations => New_List ( + Make_Attribute_Reference (Loc, + Attribute_Name => Name_Unchecked_Access, + Prefix => Parm1), + Parm3, + New_Reference_To (RTE (RE_Simple_Call), Loc))); - Parameter_Associations => New_List ( - Make_Attribute_Reference (Loc, - Attribute_Name => Name_Unchecked_Access, - Prefix => Parm1), - Parm3, - New_Reference_To (RTE (RE_Simple_Call), Loc))); - end if; + when others => + raise Program_Error; + end case; -- Case of task type @@ -4185,7 +4185,7 @@ package body Exp_Ch9 is if Present (Ann) then Append_Elmt (Ann, Accept_Address (Ent)); - Set_Needs_Debug_Info (Ann); + Set_Debug_Info_Needed (Ann); end if; -- Create renaming declarations for the entry formals. Each reference @@ -4215,7 +4215,12 @@ package body Exp_Ch9 is Set_Etype (New_F, Etype (Formal)); Set_Scope (New_F, Ent); - Set_Needs_Debug_Info (New_F); -- That's the whole point. + + -- Now we set debug info needed on New_F even though it does + -- not come from source, so that the debugger will get the + -- right information for these generated names. + + Set_Debug_Info_Needed (New_F); if Ekind (Formal) = E_In_Parameter then Set_Ekind (New_F, E_Constant); @@ -6683,7 +6688,6 @@ package body Exp_Ch9 is procedure Expand_N_Protected_Body (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Pid : constant Entity_Id := Corresponding_Spec (N); - Has_Entries : Boolean := False; Op_Body : Node_Id; Op_Decl : Node_Id; Op_Id : Entity_Id; @@ -6893,7 +6897,6 @@ package body Exp_Ch9 is when N_Entry_Body => Op_Id := Defining_Identifier (Op_Body); - Has_Entries := True; Num_Entries := Num_Entries + 1; New_Op_Body := Build_Protected_Entry (Op_Body, Op_Id, Pid); @@ -6946,14 +6949,10 @@ package body Exp_Ch9 is -- Finally, create the body of the function that maps an entry index -- into the corresponding body index, except when there is no entry, - -- or in a ravenscar-like profile (no abort, no entry queue, 1 entry) - - if Has_Entries - and then (Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Num_Entries > 1 - or else (Has_Attach_Handler (Pid) - and then not Restricted_Profile)) + -- or in a ravenscar-like profile. + + if Corresponding_Runtime_Package (Pid) = + System_Tasking_Protected_Objects_Entries then New_Op_Body := Build_Find_Body_Index (Pid); Insert_After (Current_Node, New_Op_Body); @@ -6970,12 +6969,12 @@ package body Exp_Ch9 is if Ada_Version >= Ada_05 and then Present (Protected_Definition (Parent (Pid))) and then Present (Abstract_Interfaces - (Corresponding_Record_Type (Pid))) + (Corresponding_Record_Type (Pid))) then declare Vis_Decl : Node_Id := First (Visible_Declarations - (Protected_Definition (Parent (Pid)))); + (Protected_Definition (Parent (Pid)))); Wrap_Body : Node_Id; begin @@ -7219,11 +7218,13 @@ package body Exp_Ch9 is (Prottyp, Cdecls, Loc); begin + -- Could this be simplified using Corresponding_Runtime_Package??? + if Has_Attach_Handler (Prottyp) then Ritem := First_Rep_Item (Prottyp); while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Chars (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then Num_Attach_Handler := Num_Attach_Handler + 1; end if; @@ -7271,24 +7272,24 @@ package body Exp_Ch9 is or else (Ada_Version >= Ada_05 and then Present (Interface_List (N))) then - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Prottyp) > 1 - then - Protection_Subtype := - Make_Subtype_Indication ( - Sloc => Loc, - Subtype_Mark => - New_Reference_To (RTE (RE_Protection_Entries), Loc), - Constraint => - Make_Index_Or_Discriminant_Constraint ( - Sloc => Loc, - Constraints => New_List (Entry_Count_Expr))); + case Corresponding_Runtime_Package (Prottyp) is + when System_Tasking_Protected_Objects_Entries => + Protection_Subtype := + Make_Subtype_Indication (Loc, + Subtype_Mark => + New_Reference_To (RTE (RE_Protection_Entries), Loc), + Constraint => + Make_Index_Or_Discriminant_Constraint ( + Sloc => Loc, + Constraints => New_List (Entry_Count_Expr))); + + when System_Tasking_Protected_Objects_Single_Entry => + Protection_Subtype := + New_Reference_To (RTE (RE_Protection_Entry), Loc); - else - Protection_Subtype := - New_Reference_To (RTE (RE_Protection_Entry), Loc); - end if; + when others => + raise Program_Error; + end case; else Protection_Subtype := New_Reference_To (RTE (RE_Protection), Loc); @@ -7692,42 +7693,42 @@ package body Exp_Ch9 is Body_Id := Make_Defining_Identifier (Sloc (Prottyp), New_External_Name (Chars (Prottyp), 'A')); - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else E_Count > 1 - or else (Has_Attach_Handler (Prottyp) - and then not Restricted_Profile) - then - Body_Arr := Make_Object_Declaration (Loc, - Defining_Identifier => Body_Id, - Aliased_Present => True, - Object_Definition => - Make_Subtype_Indication (Loc, - Subtype_Mark => New_Reference_To ( - RTE (RE_Protected_Entry_Body_Array), Loc), - Constraint => - Make_Index_Or_Discriminant_Constraint (Loc, - Constraints => New_List ( - Make_Range (Loc, - Make_Integer_Literal (Loc, 1), - Make_Integer_Literal (Loc, E_Count))))), - Expression => Entries_Aggr); + case Corresponding_Runtime_Package (Prottyp) is + when System_Tasking_Protected_Objects_Entries => + Body_Arr := Make_Object_Declaration (Loc, + Defining_Identifier => Body_Id, + Aliased_Present => True, + Object_Definition => + Make_Subtype_Indication (Loc, + Subtype_Mark => New_Reference_To ( + RTE (RE_Protected_Entry_Body_Array), Loc), + Constraint => + Make_Index_Or_Discriminant_Constraint (Loc, + Constraints => New_List ( + Make_Range (Loc, + Make_Integer_Literal (Loc, 1), + Make_Integer_Literal (Loc, E_Count))))), + Expression => Entries_Aggr); + + when System_Tasking_Protected_Objects_Single_Entry => + Body_Arr := Make_Object_Declaration (Loc, + Defining_Identifier => Body_Id, + Aliased_Present => True, + Object_Definition => New_Reference_To + (RTE (RE_Entry_Body), Loc), + Expression => + Make_Aggregate (Loc, + Expressions => New_List ( + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Bdef, Loc), + Attribute_Name => Name_Unrestricted_Access), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Edef, Loc), + Attribute_Name => Name_Unrestricted_Access)))); - else - Body_Arr := Make_Object_Declaration (Loc, - Defining_Identifier => Body_Id, - Aliased_Present => True, - Object_Definition => New_Reference_To (RTE (RE_Entry_Body), Loc), - Expression => - Make_Aggregate (Loc, - Expressions => New_List ( - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Bdef, Loc), - Attribute_Name => Name_Unrestricted_Access), - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Edef, Loc), - Attribute_Name => Name_Unrestricted_Access)))); - end if; + when others => + raise Program_Error; + end case; -- A pointer to this array will be placed in the corresponding record -- by its initialization procedure so this needs to be analyzed here. @@ -7743,11 +7744,8 @@ package body Exp_Ch9 is -- object of the type. Except for a ravenscar-like profile (no abort, -- no entry queue, 1 entry) - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else E_Count > 1 - or else (Has_Attach_Handler (Prottyp) - and then not Restricted_Profile) + if Corresponding_Runtime_Package (Prottyp) + = System_Tasking_Protected_Objects_Entries then Sub := Make_Subprogram_Declaration (Loc, @@ -8341,7 +8339,9 @@ package body Exp_Ch9 is Make_Defining_Identifier (Sloc (Ename), New_External_Name (Chars (Ename), 'A', Num_Accept)); - Set_Needs_Debug_Info (PB_Ent, Comes_From_Source (Alt)); + if Comes_From_Source (Alt) then + Set_Debug_Info_Needed (PB_Ent); + end if; Proc_Body := Make_Subprogram_Body (Loc, @@ -9685,7 +9685,7 @@ package body Exp_Ch9 is -- the benefit of some versions of System.Interrupts which use -- a special server task with maximum interrupt priority. - if Chars (Prag) = Name_Priority + if Pragma_Name (Prag) = Name_Priority and then not GNAT_Mode then Rewrite (Expr, Convert_To (RTE (RE_Priority), Expr)); @@ -9772,8 +9772,9 @@ package body Exp_Ch9 is -- The subprogram does not comes from source, so we have to indicate the -- need for debugging information explicitly. - Set_Needs_Debug_Info - (Defining_Entity (Proc_Spec), Comes_From_Source (Original_Node (N))); + if Comes_From_Source (Original_Node (N)) then + Set_Debug_Info_Needed (Defining_Entity (Proc_Spec)); + end if; -- Ada 2005 (AI-345): Construct the primitive entry wrapper specs before -- the corresponding record has been frozen. @@ -10358,32 +10359,35 @@ package body Exp_Ch9 is Append_To (Params, New_Reference_To (B, Loc)); - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Etype (Concval)) > 1 - then - Rewrite (Call, - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (RTE ( - RE_Timed_Protected_Entry_Call), Loc), - Parameter_Associations => Params)); - else - Param := First (Params); - while Present (Param) - and then not Is_RTE (Etype (Param), RE_Protected_Entry_Index) - loop - Next (Param); - end loop; + case Corresponding_Runtime_Package (Etype (Concval)) is + when System_Tasking_Protected_Objects_Entries => + Rewrite (Call, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (RTE (RE_Timed_Protected_Entry_Call), Loc), + Parameter_Associations => Params)); + + when System_Tasking_Protected_Objects_Single_Entry => + Param := First (Params); + while Present (Param) + and then not + Is_RTE (Etype (Param), RE_Protected_Entry_Index) + loop + Next (Param); + end loop; - Remove (Param); + Remove (Param); - Rewrite (Call, - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - RTE (RE_Timed_Protected_Single_Entry_Call), Loc), - Parameter_Associations => Params)); - end if; + Rewrite (Call, + Make_Procedure_Call_Statement (Loc, + Name => New_Reference_To ( + RTE (RE_Timed_Protected_Single_Entry_Call), Loc), + Parameter_Associations => Params)); + + when others => + raise Program_Error; + end case; -- For the task case, build a Timed_Task_Entry_Call @@ -10749,11 +10753,11 @@ package body Exp_Ch9 is N := First (Visible_Declarations (T)); while Present (N) loop if Nkind (N) = N_Pragma then - if Chars (N) = P then + if Pragma_Name (N) = P then return N; elsif P = Name_Priority - and then Chars (N) = Name_Interrupt_Priority + and then Pragma_Name (N) = Name_Interrupt_Priority then return N; @@ -10769,11 +10773,11 @@ package body Exp_Ch9 is N := First (Private_Declarations (T)); while Present (N) loop if Nkind (N) = N_Pragma then - if Chars (N) = P then + if Pragma_Name (N) = P then return N; elsif P = Name_Priority - and then Chars (N) = Name_Interrupt_Priority + and then Pragma_Name (N) = Name_Interrupt_Priority then return N; @@ -11071,79 +11075,76 @@ package body Exp_Ch9 is if Has_Entry or else Has_Interrupt_Handler (Ptyp) or else Has_Attach_Handler (Ptyp) - or else (Ada_Version >= Ada_05 - and then Present (Interface_List (Parent (Ptyp)))) + or else Has_Abstract_Interfaces (Protect_Rec) then - if Has_Entry or else not Restricted then - Append_To (Args, - Make_Attribute_Reference (Loc, - Prefix => Make_Identifier (Loc, Name_uInit), - Attribute_Name => Name_Address)); - end if; + declare + Pkg_Id : constant RTU_Id := Corresponding_Runtime_Package (Ptyp); - -- Entry_Bodies parameter. This is a pointer to an array of pointers - -- to the entry body procedures and barrier functions of the object. - -- If the protected type has no entries this object will not exist; - -- in this case, pass a null. + Called_Subp : RE_Id; - if Has_Entry then - P_Arr := Entry_Bodies_Array (Ptyp); + begin + case Pkg_Id is + when System_Tasking_Protected_Objects_Entries => + Called_Subp := RE_Initialize_Protection_Entries; - Append_To (Args, - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (P_Arr, Loc), - Attribute_Name => Name_Unrestricted_Access)); + when System_Tasking_Protected_Objects => + Called_Subp := RE_Initialize_Protection; - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Ptyp) > 1 - or else (Has_Attach_Handler (Ptyp) and then not Restricted) - then - -- Find index mapping function (clumsy but ok for now) + when System_Tasking_Protected_Objects_Single_Entry => + Called_Subp := RE_Initialize_Protection_Entry; - while Ekind (P_Arr) /= E_Function loop - Next_Entity (P_Arr); - end loop; + when others => + raise Program_Error; + end case; + if Has_Entry or else not Restricted then Append_To (Args, - Make_Attribute_Reference (Loc, - Prefix => - New_Reference_To (P_Arr, Loc), - Attribute_Name => Name_Unrestricted_Access)); + Make_Attribute_Reference (Loc, + Prefix => Make_Identifier (Loc, Name_uInit), + Attribute_Name => Name_Address)); end if; - elsif not Restricted then - Append_To (Args, Make_Null (Loc)); - Append_To (Args, Make_Null (Loc)); - end if; + -- Entry_Bodies parameter. This is a pointer to an array of + -- pointers to the entry body procedures and barrier functions of + -- the object. If the protected type has no entries this object + -- will not exist, in this case, pass a null. - if Abort_Allowed - or else Restriction_Active (No_Entry_Queue) = False - or else Number_Entries (Ptyp) > 1 - or else (Has_Attach_Handler (Ptyp) - and then not Restricted) - then - Append_To (L, - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - RTE (RE_Initialize_Protection_Entries), Loc), - Parameter_Associations => Args)); + if Has_Entry then + P_Arr := Entry_Bodies_Array (Ptyp); - elsif not Has_Entry and then Restricted then - Append_To (L, - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - RTE (RE_Initialize_Protection), Loc), - Parameter_Associations => Args)); + Append_To (Args, + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (P_Arr, Loc), + Attribute_Name => Name_Unrestricted_Access)); + + if Pkg_Id = System_Tasking_Protected_Objects_Entries then + + -- Find index mapping function (clumsy but ok for now) + + while Ekind (P_Arr) /= E_Function loop + Next_Entity (P_Arr); + end loop; + + Append_To (Args, + Make_Attribute_Reference (Loc, + Prefix => + New_Reference_To (P_Arr, Loc), + Attribute_Name => Name_Unrestricted_Access)); + end if; + + elsif Pkg_Id = System_Tasking_Protected_Objects_Single_Entry then + Append_To (Args, Make_Null (Loc)); + + elsif Pkg_Id = System_Tasking_Protected_Objects_Entries then + Append_To (Args, Make_Null (Loc)); + Append_To (Args, Make_Null (Loc)); + end if; - else Append_To (L, Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - RTE (RE_Initialize_Protection_Entry), Loc), + Name => New_Reference_To (RTE (Called_Subp), Loc), Parameter_Associations => Args)); - end if; - + end; else Append_To (L, Make_Procedure_Call_Statement (Loc, @@ -11167,7 +11168,7 @@ package body Exp_Ch9 is declare Args : constant List_Id := New_List; Table : constant List_Id := New_List; - Ritem : Node_Id := First_Rep_Item (Ptyp); + Ritem : Node_Id := First_Rep_Item (Ptyp); begin if not Restricted then @@ -11187,14 +11188,14 @@ package body Exp_Ch9 is while Present (Ritem) loop if Nkind (Ritem) = N_Pragma - and then Chars (Ritem) = Name_Attach_Handler + and then Pragma_Name (Ritem) = Name_Attach_Handler then declare Handler : constant Node_Id := First (Pragma_Argument_Associations (Ritem)); - Interrupt : constant Node_Id := Next (Handler); - Expr : constant Node_Id := Expression (Interrupt); + Interrupt : constant Node_Id := Next (Handler); + Expr : constant Node_Id := Expression (Interrupt); begin Append_To (Table, @@ -11473,9 +11474,11 @@ package body Exp_Ch9 is and then (Nkind_In (Stmt, N_Null_Statement, N_Label) or else (Nkind (Stmt) = N_Pragma - and then (Chars (Stmt) = Name_Unreferenced + and then (Pragma_Name (Stmt) = Name_Unreferenced + or else + Pragma_Name (Stmt) = Name_Unmodified or else - Chars (Stmt) = Name_Warnings))) + Pragma_Name (Stmt) = Name_Warnings))) loop Next (Stmt); end loop; diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb index 3a28087c209..39e5bde8400 100644 --- a/gcc/ada/exp_dbug.adb +++ b/gcc/ada/exp_dbug.adb @@ -464,7 +464,7 @@ package body Exp_Dbug is Set_Debug_Renaming_Link (Obj, Entity (Ren)); - Set_Needs_Debug_Info (Obj); + Set_Debug_Info_Needed (Obj); -- Mark the object as internal so that it won't be initialized when -- pragma Initialize_Scalars or Normalize_Scalars is in use. diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index de26ec249fa..c14c7348dea 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -46,6 +46,7 @@ with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Ch6; use Sem_Ch6; +with Sem_Ch7; use Sem_Ch7; with Sem_Ch8; use Sem_Ch8; with Sem_Disp; use Sem_Disp; with Sem_Eval; use Sem_Eval; @@ -175,14 +176,14 @@ package body Exp_Disp is /= E_Record_Subtype then declare - E1, E2 : Entity_Id; + E1 : constant Entity_Id := Defining_Entity (D); + E2 : constant Entity_Id := Full_View (Defining_Entity (D)); + begin - E1 := Defining_Entity (D); - E2 := Full_View (Defining_Entity (D)); - Exchange_Entities (E1, E2); + Exchange_Declarations (E1); Insert_List_After_And_Analyze (Last (Target_List), Make_DT (E1)); - Exchange_Entities (E1, E2); + Exchange_Declarations (E2); end; end if; @@ -612,6 +613,7 @@ package body Exp_Disp is Set_Etype (Subp_Ptr_Typ, Subp_Ptr_Typ); Set_Directly_Designated_Type (Subp_Ptr_Typ, Subp_Typ); + Set_Convention (Subp_Ptr_Typ, Convention (Subp_Typ)); -- If the controlling argument is a value of type Ada.Tag or an abstract -- interface class-wide type then use it directly. Otherwise, the tag @@ -1531,6 +1533,7 @@ package body Exp_Disp is Decls : constant List_Id := New_List; DT_Ptr : Entity_Id; Loc : constant Source_Ptr := Sloc (Typ); + Obj_Ref : Node_Id; Stmts : constant List_Id := New_List; begin @@ -1593,46 +1596,78 @@ package body Exp_Disp is Object_Definition => New_Reference_To (RTE (RE_Communication_Block), Loc))); - -- Generate: - -- Protected_Entry_Call - -- (T._object'Access, -- Object - -- Protected_Entry_Index! (I), -- E - -- P, -- Uninterpreted_Data - -- Asynchronous_Call, -- Mode - -- Bnn); -- Communication_Block + -- Build T._object'Access for calls below - -- where T is the protected object, I is the entry index, P are - -- the wrapped parameters and B is the name of the communication - -- block. + Obj_Ref := + Make_Attribute_Reference (Loc, + Attribute_Name => Name_Unchecked_Access, + Prefix => + Make_Selected_Component (Loc, + Prefix => Make_Identifier (Loc, Name_uT), + Selector_Name => Make_Identifier (Loc, Name_uObject))); - Append_To (Stmts, - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), - Parameter_Associations => - New_List ( + case Corresponding_Runtime_Package (Conc_Typ) is + when System_Tasking_Protected_Objects_Entries => - Make_Attribute_Reference (Loc, -- T._object'Access - Attribute_Name => - Name_Unchecked_Access, - Prefix => - Make_Selected_Component (Loc, - Prefix => - Make_Identifier (Loc, Name_uT), - Selector_Name => - Make_Identifier (Loc, Name_uObject))), + -- Generate: + -- Protected_Entry_Call + -- (T._object'Access, -- Object + -- Protected_Entry_Index! (I), -- E + -- P, -- Uninterpreted_Data + -- Asynchronous_Call, -- Mode + -- Bnn); -- Communication_Block + + -- where T is the protected object, I is the entry index, P + -- is the wrapped parameters and B is the name of the + -- communication block. + + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, - Make_Unchecked_Type_Conversion (Loc, -- entry index - Subtype_Mark => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc), - Expression => - Make_Identifier (Loc, Name_uI)), + Make_Unchecked_Type_Conversion (Loc, -- entry index + Subtype_Mark => + New_Reference_To + (RTE (RE_Protected_Entry_Index), Loc), + Expression => Make_Identifier (Loc, Name_uI)), - Make_Identifier (Loc, Name_uP), -- parameter block - New_Reference_To ( -- Asynchronous_Call - RTE (RE_Asynchronous_Call), Loc), + Make_Identifier (Loc, Name_uP), -- parameter block + New_Reference_To ( -- Asynchronous_Call + RTE (RE_Asynchronous_Call), Loc), + + New_Reference_To (Com_Block, Loc)))); -- comm block + + when System_Tasking_Protected_Objects_Single_Entry => + + -- Generate: + -- procedure Protected_Single_Entry_Call + -- (Object : Protection_Entry_Access; + -- Uninterpreted_Data : System.Address; + -- Mode : Call_Modes); - New_Reference_To (Com_Block, Loc)))); -- comm block + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (RTE (RE_Protected_Single_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, + + Make_Attribute_Reference (Loc, + Prefix => Make_Identifier (Loc, Name_uP), + Attribute_Name => Name_Address), + + New_Reference_To + (RTE (RE_Asynchronous_Call), Loc)))); + + when others => + raise Program_Error; + end case; -- Generate: -- B := Dummy_Communication_Block (Bnn); @@ -1660,7 +1695,7 @@ package body Exp_Disp is -- Asynchronous_Call, -- Mode -- F); -- Rendezvous_Successful - -- where T is the task object, I is the entry index, P are the + -- where T is the task object, I is the entry index, P is the -- wrapped parameters and F is the status flag. Append_To (Stmts, @@ -1669,7 +1704,6 @@ package body Exp_Disp is New_Reference_To (RTE (RE_Task_Entry_Call), Loc), Parameter_Associations => New_List ( - Make_Selected_Component (Loc, -- T._task_id Prefix => Make_Identifier (Loc, Name_uT), @@ -1843,6 +1877,7 @@ package body Exp_Disp is Conc_Typ : Entity_Id := Empty; Decls : constant List_Id := New_List; DT_Ptr : Entity_Id; + Obj_Ref : Node_Id; Stmts : constant List_Id := New_List; begin @@ -1929,46 +1964,73 @@ package body Exp_Disp is if Ekind (Conc_Typ) = E_Protected_Type then - -- Generate: - -- Protected_Entry_Call - -- (T._object'Access, -- Object - -- Protected_Entry_Index! (I), -- E - -- P, -- Uninterpreted_Data - -- Conditional_Call, -- Mode - -- Bnn); -- Block + Obj_Ref := -- T._object'Access + Make_Attribute_Reference (Loc, + Attribute_Name => Name_Unchecked_Access, + Prefix => + Make_Selected_Component (Loc, + Prefix => Make_Identifier (Loc, Name_uT), + Selector_Name => Make_Identifier (Loc, Name_uObject))); - -- where T is the protected object, I is the entry index, P are - -- the wrapped parameters and Bnn is the name of the communication - -- block. + case Corresponding_Runtime_Package (Conc_Typ) is + when System_Tasking_Protected_Objects_Entries => + -- Generate: - Append_To (Stmts, - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), - Parameter_Associations => - New_List ( + -- Protected_Entry_Call + -- (T._object'Access, -- Object + -- Protected_Entry_Index! (I), -- E + -- P, -- Uninterpreted_Data + -- Conditional_Call, -- Mode + -- Bnn); -- Block - Make_Attribute_Reference (Loc, -- T._object'Access - Attribute_Name => - Name_Unchecked_Access, - Prefix => - Make_Selected_Component (Loc, - Prefix => - Make_Identifier (Loc, Name_uT), - Selector_Name => - Make_Identifier (Loc, Name_uObject))), + -- where T is the protected object, I is the entry index, P + -- are the wrapped parameters and Bnn is the name of the + -- communication block. - Make_Unchecked_Type_Conversion (Loc, -- entry index - Subtype_Mark => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc), - Expression => - Make_Identifier (Loc, Name_uI)), + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To (RTE (RE_Protected_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, - Make_Identifier (Loc, Name_uP), -- parameter block - New_Reference_To ( -- Conditional_Call - RTE (RE_Conditional_Call), Loc), - New_Reference_To ( -- Bnn - Blk_Nam, Loc)))); + Make_Unchecked_Type_Conversion (Loc, -- entry index + Subtype_Mark => + New_Reference_To + (RTE (RE_Protected_Entry_Index), Loc), + Expression => Make_Identifier (Loc, Name_uI)), + + Make_Identifier (Loc, Name_uP), -- parameter block + + New_Reference_To ( -- Conditional_Call + RTE (RE_Conditional_Call), Loc), + New_Reference_To ( -- Bnn + Blk_Nam, Loc)))); + + when System_Tasking_Protected_Objects_Single_Entry => + + -- If we are compiling for a restricted run-time, the call + -- uses the simpler form. + + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (RTE (RE_Protected_Single_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, + + Make_Attribute_Reference (Loc, + Prefix => Make_Identifier (Loc, Name_uP), + Attribute_Name => Name_Address), + + New_Reference_To + (RTE (RE_Conditional_Call), Loc)))); + when others => + raise Program_Error; + end case; -- Generate: -- F := not Cancelled (Bnn); @@ -2339,79 +2401,83 @@ package body Exp_Disp is -- A); -- end if; - Append_To (Stmts, - Make_If_Statement (Loc, - Condition => - Make_Identifier (Loc, Name_uF), - - Then_Statements => - New_List ( - - -- Call to Requeue_Protected_Entry - - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To ( - RTE (RE_Requeue_Protected_Entry), Loc), - Parameter_Associations => - New_List ( - - Make_Unchecked_Type_Conversion (Loc, -- PEA (P) - Subtype_Mark => - New_Reference_To ( - RTE (RE_Protection_Entries_Access), Loc), - Expression => - Make_Identifier (Loc, Name_uP)), - - Make_Attribute_Reference (Loc, -- O._object'Acc - Attribute_Name => - Name_Unchecked_Access, - Prefix => - Make_Selected_Component (Loc, - Prefix => - Make_Identifier (Loc, Name_uO), - Selector_Name => - Make_Identifier (Loc, Name_uObject))), + if Restriction_Active (No_Entry_Queue) then + Append_To (Stmts, Make_Null_Statement (Loc)); + else + Append_To (Stmts, + Make_If_Statement (Loc, + Condition => + Make_Identifier (Loc, Name_uF), - Make_Unchecked_Type_Conversion (Loc, -- entry index - Subtype_Mark => - New_Reference_To ( - RTE (RE_Protected_Entry_Index), Loc), - Expression => - Make_Identifier (Loc, Name_uI)), + Then_Statements => + New_List ( - Make_Identifier (Loc, Name_uA)))), -- abort status + -- Call to Requeue_Protected_Entry - Else_Statements => - New_List ( + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To ( + RTE (RE_Requeue_Protected_Entry), Loc), + Parameter_Associations => + New_List ( + + Make_Unchecked_Type_Conversion (Loc, -- PEA (P) + Subtype_Mark => + New_Reference_To ( + RTE (RE_Protection_Entries_Access), Loc), + Expression => + Make_Identifier (Loc, Name_uP)), + + Make_Attribute_Reference (Loc, -- O._object'Acc + Attribute_Name => + Name_Unchecked_Access, + Prefix => + Make_Selected_Component (Loc, + Prefix => + Make_Identifier (Loc, Name_uO), + Selector_Name => + Make_Identifier (Loc, Name_uObject))), + + Make_Unchecked_Type_Conversion (Loc, -- entry index + Subtype_Mark => + New_Reference_To ( + RTE (RE_Protected_Entry_Index), Loc), + Expression => + Make_Identifier (Loc, Name_uI)), - -- Call to Requeue_Task_To_Protected_Entry + Make_Identifier (Loc, Name_uA)))), -- abort status - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To ( - RTE (RE_Requeue_Task_To_Protected_Entry), Loc), - Parameter_Associations => - New_List ( + Else_Statements => + New_List ( - Make_Attribute_Reference (Loc, -- O._object'Acc - Attribute_Name => - Name_Unchecked_Access, - Prefix => - Make_Selected_Component (Loc, - Prefix => - Make_Identifier (Loc, Name_uO), - Selector_Name => - Make_Identifier (Loc, Name_uObject))), + -- Call to Requeue_Task_To_Protected_Entry - Make_Unchecked_Type_Conversion (Loc, -- entry index - Subtype_Mark => - New_Reference_To ( - RTE (RE_Protected_Entry_Index), Loc), - Expression => - Make_Identifier (Loc, Name_uI)), + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To ( + RTE (RE_Requeue_Task_To_Protected_Entry), Loc), + Parameter_Associations => + New_List ( + + Make_Attribute_Reference (Loc, -- O._object'Acc + Attribute_Name => + Name_Unchecked_Access, + Prefix => + Make_Selected_Component (Loc, + Prefix => + Make_Identifier (Loc, Name_uO), + Selector_Name => + Make_Identifier (Loc, Name_uObject))), + + Make_Unchecked_Type_Conversion (Loc, -- entry index + Subtype_Mark => + New_Reference_To ( + RTE (RE_Protected_Entry_Index), Loc), + Expression => + Make_Identifier (Loc, Name_uI)), - Make_Identifier (Loc, Name_uA)))))); -- abort status + Make_Identifier (Loc, Name_uA)))))); -- abort status + end if; else pragma Assert (Is_Task_Type (Conc_Typ)); @@ -2658,6 +2724,7 @@ package body Exp_Disp is Conc_Typ : Entity_Id := Empty; Decls : constant List_Id := New_List; DT_Ptr : Entity_Id; + Obj_Ref : Node_Id; Stmts : constant List_Id := New_List; begin @@ -2727,48 +2794,83 @@ package body Exp_Disp is New_Reference_To (DT_Ptr, Loc)), Make_Identifier (Loc, Name_uS))))); + -- Protected case + if Ekind (Conc_Typ) = E_Protected_Type then - -- Generate: - -- Timed_Protected_Entry_Call ( - -- T._object'access, + -- Build T._object'Access + + Obj_Ref := + Make_Attribute_Reference (Loc, + Attribute_Name => Name_Unchecked_Access, + Prefix => + Make_Selected_Component (Loc, + Prefix => Make_Identifier (Loc, Name_uT), + Selector_Name => Make_Identifier (Loc, Name_uObject))); + + -- Normal case, No_Entry_Queue restriction not active. In this + -- case we generate: + + -- Timed_Protected_Entry_Call + -- (T._object'access, -- Protected_Entry_Index! (I), - -- P, - -- D, - -- M, - -- F); + -- P, D, M, F); -- where T is the protected object, I is the entry index, P are -- the wrapped parameters, D is the delay amount, M is the delay -- mode and F is the status flag. - Append_To (Stmts, - Make_Procedure_Call_Statement (Loc, - Name => - New_Reference_To (RTE (RE_Timed_Protected_Entry_Call), Loc), - Parameter_Associations => - New_List ( + case Corresponding_Runtime_Package (Conc_Typ) is + when System_Tasking_Protected_Objects_Entries => + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (RTE (RE_Timed_Protected_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, + + Make_Unchecked_Type_Conversion (Loc, -- entry index + Subtype_Mark => + New_Reference_To + (RTE (RE_Protected_Entry_Index), Loc), + Expression => + Make_Identifier (Loc, Name_uI)), - Make_Attribute_Reference (Loc, -- T._object'access - Attribute_Name => - Name_Unchecked_Access, - Prefix => - Make_Selected_Component (Loc, - Prefix => - Make_Identifier (Loc, Name_uT), - Selector_Name => - Make_Identifier (Loc, Name_uObject))), + Make_Identifier (Loc, Name_uP), -- parameter block + Make_Identifier (Loc, Name_uD), -- delay + Make_Identifier (Loc, Name_uM), -- delay mode + Make_Identifier (Loc, Name_uF)))); -- status flag - Make_Unchecked_Type_Conversion (Loc, -- entry index - Subtype_Mark => - New_Reference_To (RTE (RE_Protected_Entry_Index), Loc), - Expression => - Make_Identifier (Loc, Name_uI)), + when System_Tasking_Protected_Objects_Single_Entry => + -- Generate: - Make_Identifier (Loc, Name_uP), -- parameter block - Make_Identifier (Loc, Name_uD), -- delay - Make_Identifier (Loc, Name_uM), -- delay mode - Make_Identifier (Loc, Name_uF)))); -- status flag + -- Timed_Protected_Single_Entry_Call + -- (T._object'access, P, D, M, F); + + -- where T is the protected object, P is the wrapped + -- parameters, D is the delay amount, M is the delay mode, F + -- is the status flag. + + Append_To (Stmts, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (RTE (RE_Timed_Protected_Single_Entry_Call), Loc), + Parameter_Associations => + New_List ( + Obj_Ref, + Make_Identifier (Loc, Name_uP), -- parameter block + Make_Identifier (Loc, Name_uD), -- delay + Make_Identifier (Loc, Name_uM), -- delay mode + Make_Identifier (Loc, Name_uF)))); -- status flag + + when others => + raise Program_Error; + end case; + + -- Task case else pragma Assert (Ekind (Conc_Typ) = E_Task_Type); @@ -2957,12 +3059,13 @@ package body Exp_Disp is -- generate forward references and statically allocate the table. procedure Make_Secondary_DT - (Typ : Entity_Id; - Iface : Entity_Id; - Num_Iface_Prims : Nat; - Iface_DT_Ptr : Entity_Id; - Build_Thunks : Boolean; - Result : List_Id); + (Typ : Entity_Id; + Iface : Entity_Id; + Num_Iface_Prims : Nat; + Iface_DT_Ptr : Entity_Id; + Predef_Prims_Ptr : Entity_Id; + Build_Thunks : Boolean; + Result : List_Id); -- Ada 2005 (AI-251): Expand the declarations for a Secondary Dispatch -- Table of Typ associated with Iface. Each abstract interface of Typ -- has two secondary dispatch tables: one containing pointers to thunks @@ -3024,12 +3127,13 @@ package body Exp_Disp is ----------------------- procedure Make_Secondary_DT - (Typ : Entity_Id; - Iface : Entity_Id; - Num_Iface_Prims : Nat; - Iface_DT_Ptr : Entity_Id; - Build_Thunks : Boolean; - Result : List_Id) + (Typ : Entity_Id; + Iface : Entity_Id; + Num_Iface_Prims : Nat; + Iface_DT_Ptr : Entity_Id; + Predef_Prims_Ptr : Entity_Id; + Build_Thunks : Boolean; + Result : List_Id) is Loc : constant Source_Ptr := Sloc (Typ); Name_DT : constant Name_Id := New_Internal_Name ('T'); @@ -3168,9 +3272,10 @@ package body Exp_Disp is for J in Prim_Table'Range loop if Present (Prim_Table (J)) then New_Node := - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim_Table (J), Loc), - Attribute_Name => Name_Address); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim_Table (J), Loc), + Attribute_Name => Name_Unrestricted_Access)); else New_Node := New_Reference_To (RTE (RE_Null_Address), Loc); @@ -3451,9 +3556,10 @@ package body Exp_Disp is for J in Prim_Table'Range loop if Present (Prim_Table (J)) then New_Node := - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim_Table (J), Loc), - Attribute_Name => Name_Address); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim_Table (J), Loc), + Attribute_Name => Name_Unrestricted_Access)); else New_Node := New_Reference_To (RTE (RE_Null_Address), Loc); @@ -3513,6 +3619,30 @@ package body Exp_Disp is (RTE_Record_Component (RE_Prims_Ptr), Loc)), Attribute_Name => Name_Address)))); + Append_To (Result, + Make_Object_Declaration (Loc, + Defining_Identifier => Predef_Prims_Ptr, + Constant_Present => True, + Object_Definition => + New_Reference_To (RTE (RE_Address), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => + Make_Selected_Component (Loc, + Prefix => New_Reference_To (Iface_DT, Loc), + Selector_Name => + New_Occurrence_Of + (RTE_Record_Component (RE_Predef_Prims), Loc)), + Attribute_Name => Name_Address))); + + -- Mark entities containing library level static dispatch tables. + -- This attribute is later propagated to all the access-to-subprogram + -- itypes generated to fill the dispatch table slots (see exp_attr). + + if Building_Static_DT (Typ) then + Set_Is_Static_Dispatch_Table_Entity (Predef_Prims); + Set_Is_Static_Dispatch_Table_Entity (Iface_DT); + end if; end Make_Secondary_DT; -- Local variables @@ -3535,10 +3665,7 @@ package body Exp_Disp is Nb_Prim : Nat := 0; New_Node : Node_Id; No_Reg : Node_Id; - Null_Parent_Tag : Boolean := False; Num_Ifaces : Nat := 0; - Old_Tag1 : Node_Id; - Old_Tag2 : Node_Id; Prim : Entity_Id; Prim_Elmt : Elmt_Id; Prim_Ops_Aggr_List : List_Id; @@ -3686,7 +3813,8 @@ package body Exp_Disp is Collect_Interface_Components (Typ, Typ_Comps); Suffix_Index := 0; - AI_Tag_Elmt := Next_Elmt (First_Elmt (Access_Disp_Table (Typ))); + AI_Tag_Elmt := + Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (Typ)))); AI_Tag_Comp := First_Elmt (Typ_Comps); while Present (AI_Tag_Comp) loop @@ -3699,10 +3827,15 @@ package body Exp_Disp is Num_Iface_Prims => UI_To_Int (DT_Entry_Count (Node (AI_Tag_Comp))), Iface_DT_Ptr => Node (AI_Tag_Elmt), + Predef_Prims_Ptr => Node (Next_Elmt (AI_Tag_Elmt)), Build_Thunks => True, Result => Result); Next_Elmt (AI_Tag_Elmt); + -- Skip the secondary dispatch table of predefined primitives + + Next_Elmt (AI_Tag_Elmt); + -- Build the secondary table containing pointers to primitives -- (used to give support to Generic Dispatching Constructors). @@ -3712,10 +3845,15 @@ package body Exp_Disp is Num_Iface_Prims => UI_To_Int (DT_Entry_Count (Node (AI_Tag_Comp))), Iface_DT_Ptr => Node (AI_Tag_Elmt), + Predef_Prims_Ptr => Node (Next_Elmt (AI_Tag_Elmt)), Build_Thunks => False, Result => Result); Next_Elmt (AI_Tag_Elmt); + -- Skip the secondary dispatch table of predefined primitives + + Next_Elmt (AI_Tag_Elmt); + Suffix_Index := Suffix_Index + 1; Next_Elmt (AI_Tag_Comp); end loop; @@ -3850,6 +3988,23 @@ package body Exp_Disp is New_Occurrence_Of (RTE_Record_Component (RE_Prims_Ptr), Loc)), Attribute_Name => Name_Address)))); + + Append_To (Result, + Make_Object_Declaration (Loc, + Defining_Identifier => + Node (Next_Elmt (First_Elmt (Access_Disp_Table (Typ)))), + Constant_Present => True, + Object_Definition => New_Reference_To + (RTE (RE_Address), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => + Make_Selected_Component (Loc, + Prefix => New_Reference_To (DT, Loc), + Selector_Name => + New_Occurrence_Of + (RTE_Record_Component (RE_Predef_Prims), Loc)), + Attribute_Name => Name_Address))); end if; end if; @@ -4245,7 +4400,9 @@ package body Exp_Disp is Sec_DT_Tag := New_Reference_To (DT_Ptr, Loc); else - Elmt := Next_Elmt (First_Elmt (Access_Disp_Table (Typ))); + Elmt := + Next_Elmt + (Next_Elmt (First_Elmt (Access_Disp_Table (Typ)))); pragma Assert (Has_Thunks (Node (Elmt))); while Ekind (Node (Elmt)) = E_Constant @@ -4254,14 +4411,20 @@ package body Exp_Disp is loop pragma Assert (Has_Thunks (Node (Elmt))); Next_Elmt (Elmt); + pragma Assert (Has_Thunks (Node (Elmt))); + Next_Elmt (Elmt); + pragma Assert (not Has_Thunks (Node (Elmt))); + Next_Elmt (Elmt); pragma Assert (not Has_Thunks (Node (Elmt))); Next_Elmt (Elmt); end loop; pragma Assert (Ekind (Node (Elmt)) = E_Constant - and then not Has_Thunks (Node (Next_Elmt (Elmt)))); + and then not + Has_Thunks (Node (Next_Elmt (Next_Elmt (Elmt))))); Sec_DT_Tag := - New_Reference_To (Node (Next_Elmt (Elmt)), Loc); + New_Reference_To (Node (Next_Elmt (Next_Elmt (Elmt))), + Loc); end if; Append_To (TSD_Ifaces_List, @@ -4645,9 +4808,10 @@ package body Exp_Disp is for J in Prim_Table'Range loop if Present (Prim_Table (J)) then New_Node := - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim_Table (J), Loc), - Attribute_Name => Name_Address); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim_Table (J), Loc), + Attribute_Name => Name_Unrestricted_Access)); else New_Node := New_Reference_To (RTE (RE_Null_Address), Loc); end if; @@ -4787,9 +4951,10 @@ package body Exp_Disp is for J in Prim_Table'Range loop if Present (Prim_Table (J)) then New_Node := - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim_Table (J), Loc), - Attribute_Name => Name_Address); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim_Table (J), Loc), + Attribute_Name => Name_Unrestricted_Access)); else New_Node := New_Reference_To (RTE (RE_Null_Address), Loc); end if; @@ -4871,6 +5036,12 @@ package body Exp_Disp is (Node (First_Elmt (Access_Disp_Table (Typ))), Loc))); end if; + -- Inherit the dispatch tables of the parent + + -- There is no need to inherit anything from the parent when building + -- static dispatch tables because the whole dispatch table (including + -- inherited primitives) has been already built. + if Building_Static_DT (Typ) then null; @@ -4880,60 +5051,52 @@ package body Exp_Disp is elsif Is_CPP_Class (Etype (Typ)) then null; - -- Otherwise we fill in the dispatch tables here + -- Otherwise we fill in the dispatch tables here else - if Typ = Etype (Typ) - or else Is_CPP_Class (Etype (Typ)) - or else Is_Interface (Typ) - then - Null_Parent_Tag := True; - - Old_Tag1 := - Unchecked_Convert_To (RTE (RE_Tag), - Make_Integer_Literal (Loc, 0)); - Old_Tag2 := - Unchecked_Convert_To (RTE (RE_Tag), - Make_Integer_Literal (Loc, 0)); - - else - Old_Tag1 := - New_Reference_To - (Node (First_Elmt (Access_Disp_Table (Etype (Typ)))), Loc); - Old_Tag2 := - New_Reference_To - (Node (First_Elmt (Access_Disp_Table (Etype (Typ)))), Loc); - end if; - if Typ /= Etype (Typ) and then not Is_Interface (Typ) and then not Restriction_Active (No_Dispatching_Calls) then -- Inherit the dispatch table - if not Is_Interface (Etype (Typ)) then - if not Null_Parent_Tag then - declare - Nb_Prims : constant Int := - UI_To_Int (DT_Entry_Count - (First_Tag_Component (Etype (Typ)))); - begin + if not Is_Interface (Typ) + and then not Is_Interface (Etype (Typ)) + and then not Is_CPP_Class (Etype (Typ)) + then + declare + Nb_Prims : constant Int := + UI_To_Int (DT_Entry_Count + (First_Tag_Component (Etype (Typ)))); + begin + Append_To (Elab_Code, + Build_Inherit_Predefined_Prims (Loc, + Old_Tag_Node => + New_Reference_To + (Node + (Next_Elmt + (First_Elmt + (Access_Disp_Table (Etype (Typ))))), Loc), + New_Tag_Node => + New_Reference_To + (Node + (Next_Elmt + (First_Elmt + (Access_Disp_Table (Typ)))), Loc))); + + if Nb_Prims /= 0 then Append_To (Elab_Code, - Build_Inherit_Predefined_Prims (Loc, - Old_Tag_Node => Old_Tag1, - New_Tag_Node => - New_Reference_To (DT_Ptr, Loc))); - - if Nb_Prims /= 0 then - Append_To (Elab_Code, - Build_Inherit_Prims (Loc, - Typ => Typ, - Old_Tag_Node => Old_Tag2, - New_Tag_Node => New_Reference_To (DT_Ptr, Loc), - Num_Prims => Nb_Prims)); - end if; - end; - end if; + Build_Inherit_Prims (Loc, + Typ => Typ, + Old_Tag_Node => + New_Reference_To + (Node + (First_Elmt + (Access_Disp_Table (Etype (Typ)))), Loc), + New_Tag_Node => New_Reference_To (DT_Ptr, Loc), + Num_Prims => Nb_Prims)); + end if; + end; end if; -- Inherit the secondary dispatch tables of the ancestor @@ -4942,12 +5105,14 @@ package body Exp_Disp is declare Sec_DT_Ancestor : Elmt_Id := Next_Elmt + (Next_Elmt (First_Elmt - (Access_Disp_Table (Etype (Typ)))); + (Access_Disp_Table (Etype (Typ))))); Sec_DT_Typ : Elmt_Id := Next_Elmt - (First_Elmt - (Access_Disp_Table (Typ))); + (Next_Elmt + (First_Elmt + (Access_Disp_Table (Typ)))); procedure Copy_Secondary_DTs (Typ : Entity_Id); -- Local procedure required to climb through the ancestors @@ -4998,12 +5163,15 @@ package body Exp_Disp is Build_Inherit_Predefined_Prims (Loc, Old_Tag_Node => Unchecked_Convert_To (RTE (RE_Tag), - New_Reference_To - (Node (Sec_DT_Ancestor), Loc)), + New_Reference_To + (Node + (Next_Elmt (Sec_DT_Ancestor)), + Loc)), New_Tag_Node => Unchecked_Convert_To (RTE (RE_Tag), New_Reference_To - (Node (Sec_DT_Typ), Loc)))); + (Node (Next_Elmt (Sec_DT_Typ)), + Loc)))); if Num_Prims /= 0 then Append_To (Elab_Code, @@ -5027,6 +5195,12 @@ package body Exp_Disp is Next_Elmt (Sec_DT_Ancestor); Next_Elmt (Sec_DT_Typ); + -- Skip the secondary dispatch table of + -- predefined primitives + + Next_Elmt (Sec_DT_Ancestor); + Next_Elmt (Sec_DT_Typ); + if not Is_Interface (Etype (Typ)) then -- Inherit second secondary dispatch table @@ -5036,11 +5210,14 @@ package body Exp_Disp is Old_Tag_Node => Unchecked_Convert_To (RTE (RE_Tag), New_Reference_To - (Node (Sec_DT_Ancestor), Loc)), + (Node + (Next_Elmt (Sec_DT_Ancestor)), + Loc)), New_Tag_Node => Unchecked_Convert_To (RTE (RE_Tag), New_Reference_To - (Node (Sec_DT_Typ), Loc)))); + (Node (Next_Elmt (Sec_DT_Typ)), + Loc)))); if Num_Prims /= 0 then Append_To (Elab_Code, @@ -5064,6 +5241,13 @@ package body Exp_Disp is Next_Elmt (Sec_DT_Ancestor); Next_Elmt (Sec_DT_Typ); + + -- Skip the secondary dispatch table of + -- predefined primitives + + Next_Elmt (Sec_DT_Ancestor); + Next_Elmt (Sec_DT_Typ); + Next_Elmt (Iface); end if; @@ -5143,6 +5327,15 @@ package body Exp_Disp is Make_Select_Specific_Data_Table (Typ)); end if; + -- Mark entities containing library level static dispatch tables. This + -- attribute is later propagated to all the access-to-subprogram itypes + -- generated to fill the dispatch table slots (see exp_attr). + + if Building_Static_DT (Typ) then + Set_Is_Static_Dispatch_Table_Entity (Predef_Prims); + Set_Is_Static_Dispatch_Table_Entity (DT); + end if; + Analyze_List (Result, Suppress => All_Checks); Set_Has_Dispatch_Table (Typ); @@ -5312,18 +5505,19 @@ package body Exp_Disp is --------------- function Make_Tags (Typ : Entity_Id) return List_Id is - Loc : constant Source_Ptr := Sloc (Typ); - Tname : constant Name_Id := Chars (Typ); - Result : constant List_Id := New_List; - AI_Tag_Comp : Elmt_Id; - DT : Node_Id; - DT_Constr_List : List_Id; - DT_Ptr : Node_Id; - Iface_DT_Ptr : Node_Id; - Nb_Prim : Nat; - Suffix_Index : Int; - Typ_Name : Name_Id; - Typ_Comps : Elist_Id; + Loc : constant Source_Ptr := Sloc (Typ); + Tname : constant Name_Id := Chars (Typ); + Result : constant List_Id := New_List; + AI_Tag_Comp : Elmt_Id; + DT : Node_Id; + DT_Constr_List : List_Id; + DT_Ptr : Node_Id; + Predef_Prims_Ptr : Node_Id; + Iface_DT_Ptr : Node_Id; + Nb_Prim : Nat; + Suffix_Index : Int; + Typ_Name : Name_Id; + Typ_Comps : Elist_Id; begin -- 1) Generate the primary and secondary tag entities @@ -5334,18 +5528,28 @@ package body Exp_Disp is Collect_Interface_Components (Typ, Typ_Comps); end if; - -- 1) Generate the primary tag entity + -- 1) Generate the primary tag entities + + -- Primary dispatch table containing user-defined primitives DT_Ptr := Make_Defining_Identifier (Loc, New_External_Name (Tname, 'P')); Set_Etype (DT_Ptr, RTE (RE_Tag)); + -- Primary dispatch table containing predefined primitives + + Predef_Prims_Ptr := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Tname, 'Y')); + Set_Etype (Predef_Prims_Ptr, RTE (RE_Address)); + -- Import the forward declaration of the Dispatch Table wrapper record -- (Make_DT will take care of its exportation) if Building_Static_DT (Typ) then - DT := Make_Defining_Identifier (Loc, - New_External_Name (Tname, 'T')); + DT := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Tname, 'T')); -- Generate: -- DT : static aliased constant Dispatch_Table_Wrapper (Nb_Prim); @@ -5371,6 +5575,7 @@ package body Exp_Disp is Set_Dispatch_Table_Wrapper (Typ, DT); if Has_DT (Typ) then + -- Calculate the number of primitives of the dispatch table and -- the size of the Type_Specific_Data record. @@ -5415,6 +5620,22 @@ package body Exp_Disp is (RTE_Record_Component (RE_Prims_Ptr), Loc)), Attribute_Name => Name_Address)))); + Append_To (Result, + Make_Object_Declaration (Loc, + Defining_Identifier => Predef_Prims_Ptr, + Constant_Present => True, + Object_Definition => New_Reference_To + (RTE (RE_Address), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => + Make_Selected_Component (Loc, + Prefix => New_Reference_To (DT, Loc), + Selector_Name => + New_Occurrence_Of + (RTE_Record_Component (RE_Predef_Prims), Loc)), + Attribute_Name => Name_Address))); + -- No dispatch table required else @@ -5450,6 +5671,7 @@ package body Exp_Disp is pragma Assert (No (Access_Disp_Table (Typ))); Set_Access_Disp_Table (Typ, New_Elmt_List); Append_Elmt (DT_Ptr, Access_Disp_Table (Typ)); + Append_Elmt (Predef_Prims_Ptr, Access_Disp_Table (Typ)); -- 2) Generate the secondary tag entities @@ -5471,6 +5693,9 @@ package body Exp_Disp is Typ_Name := Name_Find; + -- Secondary dispatch table referencing thunks to user-defined + -- primitives covered by this interface. + Iface_DT_Ptr := Make_Defining_Identifier (Loc, Chars => New_External_Name (Typ_Name, 'P')); @@ -5484,6 +5709,25 @@ package body Exp_Disp is (Iface_DT_Ptr, Related_Type (Node (AI_Tag_Comp))); Append_Elmt (Iface_DT_Ptr, Access_Disp_Table (Typ)); + -- Secondary dispatch table referencing thunks to predefined + -- primitives. + + Iface_DT_Ptr := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Typ_Name, 'Y')); + Set_Etype (Iface_DT_Ptr, RTE (RE_Address)); + Set_Ekind (Iface_DT_Ptr, E_Constant); + Set_Is_Tag (Iface_DT_Ptr); + Set_Has_Thunks (Iface_DT_Ptr); + Set_Is_Statically_Allocated (Iface_DT_Ptr); + Set_Is_True_Constant (Iface_DT_Ptr); + Set_Related_Type + (Iface_DT_Ptr, Related_Type (Node (AI_Tag_Comp))); + Append_Elmt (Iface_DT_Ptr, Access_Disp_Table (Typ)); + + -- Secondary dispatch table referencing user-defined primitives + -- covered by this interface. + Iface_DT_Ptr := Make_Defining_Identifier (Loc, Chars => New_External_Name (Typ_Name, 'D')); @@ -5496,6 +5740,20 @@ package body Exp_Disp is (Iface_DT_Ptr, Related_Type (Node (AI_Tag_Comp))); Append_Elmt (Iface_DT_Ptr, Access_Disp_Table (Typ)); + -- Secondary dispatch table referencing predefined primitives + + Iface_DT_Ptr := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Typ_Name, 'Z')); + Set_Etype (Iface_DT_Ptr, RTE (RE_Address)); + Set_Ekind (Iface_DT_Ptr, E_Constant); + Set_Is_Tag (Iface_DT_Ptr); + Set_Is_Statically_Allocated (Iface_DT_Ptr); + Set_Is_True_Constant (Iface_DT_Ptr); + Set_Related_Type + (Iface_DT_Ptr, Related_Type (Node (AI_Tag_Comp))); + Append_Elmt (Iface_DT_Ptr, Access_Disp_Table (Typ)); + Next_Elmt (AI_Tag_Comp); end loop; end if; @@ -5703,33 +5961,38 @@ package body Exp_Disp is end if; if not Present (Abstract_Interface_Alias (Prim)) then - Typ := Scope (DTC_Entity (Prim)); - DT_Ptr := Node (First_Elmt (Access_Disp_Table (Typ))); - Pos := DT_Position (Prim); - Tag := First_Tag_Component (Typ); + Typ := Scope (DTC_Entity (Prim)); + Pos := DT_Position (Prim); + Tag := First_Tag_Component (Typ); if Is_Predefined_Dispatching_Operation (Prim) or else Is_Predefined_Dispatching_Alias (Prim) then + DT_Ptr := Node (Next_Elmt (First_Elmt (Access_Disp_Table (Typ)))); Insert_After (Ins_Nod, Build_Set_Predefined_Prim_Op_Address (Loc, Tag_Node => New_Reference_To (DT_Ptr, Loc), Position => Pos, - Address_Node => Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim, Loc), - Attribute_Name => Name_Address))); + Address_Node => + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim, Loc), + Attribute_Name => Name_Unrestricted_Access)))); else pragma Assert (Pos /= Uint_0 and then Pos <= DT_Entry_Count (Tag)); + DT_Ptr := Node (First_Elmt (Access_Disp_Table (Typ))); Insert_After (Ins_Nod, Build_Set_Prim_Op_Address (Loc, Typ => Typ, Tag_Node => New_Reference_To (DT_Ptr, Loc), Position => Pos, - Address_Node => Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Prim, Loc), - Attribute_Name => Name_Address))); + Address_Node => + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Prim, Loc), + Attribute_Name => Name_Unrestricted_Access)))); end if; -- Ada 2005 (AI-251): Primitive associated with an interface type @@ -5763,35 +6026,40 @@ package body Exp_Disp is Iface_DT_Ptr := Node (Iface_DT_Elmt); pragma Assert (Has_Thunks (Iface_DT_Ptr)); - Iface_Prim := Abstract_Interface_Alias (Prim); - Pos := DT_Position (Iface_Prim); - Tag := First_Tag_Component (Iface_Typ); - L := New_List; + Iface_Prim := Abstract_Interface_Alias (Prim); + Pos := DT_Position (Iface_Prim); + Tag := First_Tag_Component (Iface_Typ); + L := New_List; if Is_Predefined_Dispatching_Operation (Prim) or else Is_Predefined_Dispatching_Alias (Prim) then Append_To (L, Build_Set_Predefined_Prim_Op_Address (Loc, - Tag_Node => New_Reference_To (Iface_DT_Ptr, Loc), + Tag_Node => + New_Reference_To (Node (Next_Elmt (Iface_DT_Elmt)), Loc), Position => Pos, Address_Node => - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Thunk_Id, Loc), - Attribute_Name => Name_Address))); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Thunk_Id, Loc), + Attribute_Name => Name_Unrestricted_Access)))); Next_Elmt (Iface_DT_Elmt); + Next_Elmt (Iface_DT_Elmt); Iface_DT_Ptr := Node (Iface_DT_Elmt); pragma Assert (not Has_Thunks (Iface_DT_Ptr)); Append_To (L, Build_Set_Predefined_Prim_Op_Address (Loc, - Tag_Node => New_Reference_To (Iface_DT_Ptr, Loc), + Tag_Node => + New_Reference_To (Node (Next_Elmt (Iface_DT_Elmt)), Loc), Position => Pos, Address_Node => - Make_Attribute_Reference (Loc, - Prefix => New_Reference_To (Alias (Prim), Loc), - Attribute_Name => Name_Address))); + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Alias (Prim), Loc), + Attribute_Name => Name_Unrestricted_Access)))); Insert_Actions_After (Ins_Nod, L); @@ -5804,12 +6072,14 @@ package body Exp_Disp is Typ => Iface_Typ, Tag_Node => New_Reference_To (Iface_DT_Ptr, Loc), Position => Pos, - Address_Node => Make_Attribute_Reference (Loc, - Prefix => - New_Reference_To (Thunk_Id, Loc), - Attribute_Name => Name_Address))); + Address_Node => + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Thunk_Id, Loc), + Attribute_Name => Name_Unrestricted_Access)))); Next_Elmt (Iface_DT_Elmt); + Next_Elmt (Iface_DT_Elmt); Iface_DT_Ptr := Node (Iface_DT_Elmt); pragma Assert (not Has_Thunks (Iface_DT_Ptr)); @@ -5818,10 +6088,11 @@ package body Exp_Disp is Typ => Iface_Typ, Tag_Node => New_Reference_To (Iface_DT_Ptr, Loc), Position => Pos, - Address_Node => Make_Attribute_Reference (Loc, - Prefix => - New_Reference_To (Alias (Prim), Loc), - Attribute_Name => Name_Address))); + Address_Node => + Unchecked_Convert_To (RTE (RE_Address), + Make_Attribute_Reference (Loc, + Prefix => New_Reference_To (Alias (Prim), Loc), + Attribute_Name => Name_Unrestricted_Access)))); Insert_Actions_After (Ins_Nod, L); end if; @@ -5980,8 +6251,9 @@ package body Exp_Disp is end loop; declare - Fixed_Prim : array (Int range 0 .. Count_Prim) of Boolean - := (others => False); + Fixed_Prim : array (Int range 0 .. Count_Prim) of Boolean := + (others => False); + E : Entity_Id; procedure Handle_Inherited_Private_Subprograms (Typ : Entity_Id); @@ -6231,7 +6503,7 @@ package body Exp_Disp is Prim := Node (Prim_Elmt); -- At this point all the primitives MUST have a position - -- in the dispatch table + -- in the dispatch table. if DT_Position (Prim) = No_Uint then raise Program_Error; @@ -6322,8 +6594,7 @@ package body Exp_Disp is Set_DT_Entry_Count (The_Tag, UI_From_Int (DT_Length)); -- The derived type must have at least as many components as its parent - -- (for root types, the Etype points back to itself and the test cannot - -- fail) + -- (for root types Etype points to itself and the test cannot fail). if DT_Entry_Count (The_Tag) < DT_Entry_Count (First_Tag_Component (Parent_Typ)) diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index f3ead191c96..68feec5aa3f 100644 --- a/gcc/ada/exp_pakd.adb +++ b/gcc/ada/exp_pakd.adb @@ -33,6 +33,7 @@ with Layout; use Layout; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; +with Opt; use Opt; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Ch3; use Sem_Ch3; @@ -1359,7 +1360,19 @@ package body Exp_Pakd is Rhs := Convert_To (Ctyp, Rhs); Set_Parent (Rhs, N); - Analyze_And_Resolve (Rhs, Ctyp); + + -- If we are building the initialization procedure for a packed array, + -- and Initialize_Scalars is enabled, each component assignment is an + -- out-of-range value by design. Compile this value without checks, + -- because a call to the array init_proc must not raise an exception. + + if Within_Init_Proc + and then Initialize_Scalars + then + Analyze_And_Resolve (Rhs, Ctyp, Suppress => All_Checks); + else + Analyze_And_Resolve (Rhs, Ctyp); + end if; -- Case of component size 1,2,4 or any component size for the modular -- case. These are the cases for which we can inline the code. diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 27869a83827..deabc2d27bd 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -116,12 +116,14 @@ package body Exp_Prag is --------------------- procedure Expand_N_Pragma (N : Node_Id) is + Pname : constant Name_Id := Pragma_Name (N); + begin - -- Note: we may have a pragma whose chars field is not a + -- Note: we may have a pragma whose Pragma_Identifier field is not a -- recognized pragma, and we must ignore it at this stage. - if Is_Pragma_Name (Chars (N)) then - case Get_Pragma_Id (Chars (N)) is + if Is_Pragma_Name (Pname) then + case Get_Pragma_Id (Pname) is -- Pragmas requiring special expander action @@ -350,6 +352,8 @@ package body Exp_Prag is -- For now we do nothing with the size attribute ??? + -- Note: Psect_Object shares this processing + procedure Expand_Pragma_Common_Object (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); @@ -392,7 +396,6 @@ package body Exp_Prag is -- Insert the pragma Insert_After_And_Analyze (N, - Make_Pragma (Loc, Chars => Name_Machine_Attribute, Pragma_Argument_Associations => New_List ( @@ -731,10 +734,7 @@ package body Exp_Prag is -- Convert to Common_Object, and expand the resulting pragma - procedure Expand_Pragma_Psect_Object (N : Node_Id) is - begin - Set_Chars (N, Name_Common_Object); - Expand_Pragma_Common_Object (N); - end Expand_Pragma_Psect_Object; + procedure Expand_Pragma_Psect_Object (N : Node_Id) + renames Expand_Pragma_Common_Object; end Exp_Prag; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index f3b9ee2f199..28f6d6e0d9f 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -948,6 +948,43 @@ package body Exp_Util is end if; end Component_May_Be_Bit_Aligned; + ----------------------------------- + -- Corresponding_Runtime_Package -- + ----------------------------------- + + function Corresponding_Runtime_Package (Typ : Entity_Id) return RTU_Id is + Pkg_Id : RTU_Id := RTU_Null; + + begin + pragma Assert (Is_Concurrent_Type (Typ)); + + if Ekind (Typ) in Protected_Kind then + if Has_Entries (Typ) + or else Has_Interrupt_Handler (Typ) + or else (Has_Attach_Handler (Typ) + and then not Restricted_Profile) + or else (Ada_Version >= Ada_05 + and then Present (Interface_List (Parent (Typ)))) + then + if Abort_Allowed + or else Restriction_Active (No_Entry_Queue) = False + or else Number_Entries (Typ) > 1 + or else (Has_Attach_Handler (Typ) + and then not Restricted_Profile) + then + Pkg_Id := System_Tasking_Protected_Objects_Entries; + else + Pkg_Id := System_Tasking_Protected_Objects_Single_Entry; + end if; + + else + Pkg_Id := System_Tasking_Protected_Objects; + end if; + end if; + + return Pkg_Id; + end Corresponding_Runtime_Package; + ------------------------------- -- Convert_To_Actual_Subtype -- ------------------------------- @@ -1384,6 +1421,10 @@ package body Exp_Util is return; end if; + -- Document what is going on here, why four Next's??? + + Next_Elmt (ADT); + Next_Elmt (ADT); Next_Elmt (ADT); Next_Elmt (ADT); Next_Elmt (AI_Elmt); @@ -1420,7 +1461,7 @@ package body Exp_Util is (not Is_Class_Wide_Type (Typ) and then Ekind (Typ) /= E_Incomplete_Type); - ADT := Next_Elmt (First_Elmt (Access_Disp_Table (Typ))); + ADT := Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (Typ)))); pragma Assert (Present (Node (ADT))); Find_Secondary_Table (Typ); pragma Assert (Found); diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 42c8d2ab8f3..737b39728ee 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -212,43 +212,51 @@ package Exp_Util is -- function itself must do its own cleanups. function Component_May_Be_Bit_Aligned (Comp : Entity_Id) return Boolean; - -- This function is in charge of detecting record components that may cause - -- trouble in the back end if an attempt is made to assign the component. - -- The back end can handle such assignments with no problem if the - -- components involved are small (64-bits or less) records or scalar items - -- (including bit-packed arrays represented with modular types) or are both - -- aligned on a byte boundary (starting on a byte boundary, and occupying - -- an integral number of bytes). + -- This function is in charge of detecting record components that may + -- cause trouble in the back end if an attempt is made to assign the + -- component. The back end can handle such assignments with no problem if + -- the components involved are small (64-bits or less) records or scalar + -- items (including bit-packed arrays represented with modular types) or + -- are both aligned on a byte boundary (starting on a byte boundary, and + -- occupying an integral number of bytes). -- -- However, problems arise for records larger than 64 bits, or for arrays -- (other than bit-packed arrays represented with a modular type) if the -- component starts on a non-byte boundary, or does not occupy an integral - -- number of bytes (i.e. there are some bits possibly shared with fields at - -- the start or beginning of the component). The back end cannot handle + -- number of bytes (i.e. there are some bits possibly shared with fields + -- at the start or beginning of the component). The back end cannot handle -- loading and storing such components in a single operation. -- -- This function is used to detect the troublesome situation. it is - -- conservative in the sense that it produces True unless it knows for sure - -- that the component is safe (as outlined in the first paragraph above). - -- The code generation for record and array assignment checks for trouble - -- using this function, and if so the assignment is generated + -- conservative in the sense that it produces True unless it knows for + -- sure that the component is safe (as outlined in the first paragraph + -- above). The code generation for record and array assignment checks for + -- trouble using this function, and if so the assignment is generated -- component-wise, which the back end is required to handle correctly. -- - -- Note that in GNAT 3, the back end will reject such components anyway, so - -- the hard work in checking for this case is wasted in GNAT 3, but it's - -- harmless, so it is easier to do it in all cases, rather than + -- Note that in GNAT 3, the back end will reject such components anyway, + -- so the hard work in checking for this case is wasted in GNAT 3, but + -- it is harmless, so it is easier to do it in all cases, rather than -- conditionalize it in GNAT 5 or beyond. procedure Convert_To_Actual_Subtype (Exp : Node_Id); - -- The Etype of an expression is the nominal type of the expression, not - -- the actual subtype. Often these are the same, but not always. For - -- example, a reference to a formal of unconstrained type has the + -- The Etype of an expression is the nominal type of the expression, + -- not the actual subtype. Often these are the same, but not always. + -- For example, a reference to a formal of unconstrained type has the -- unconstrained type as its Etype, but the actual subtype is obtained by -- applying the actual bounds. This routine is given an expression, Exp, - -- and (if necessary), replaces it using Rewrite, with a conversion to the - -- actual subtype, building the actual subtype if necessary. If the + -- and (if necessary), replaces it using Rewrite, with a conversion to + -- the actual subtype, building the actual subtype if necessary. If the -- expression is already of the requested type, then it is unchanged. + function Corresponding_Runtime_Package (Typ : Entity_Id) return RTU_Id; + -- Return the id of the runtime package that will provide support for + -- concurrent type Typ. Currently only protected types are supported, + -- and the returned value is one of the following: + -- System_Tasking_Protected_Objects + -- System_Tasking_Protected_Objects_Entries + -- System_Tasking_Protected_Objects_Single_Entry + function Current_Sem_Unit_Declarations return List_Id; -- Return the a place where it is fine to insert declarations for the -- current semantic unit. If the unit is a package body, return the diff --git a/gcc/ada/fname.ads b/gcc/ada/fname.ads index 9e31b991c44..27c7806df2a 100644 --- a/gcc/ada/fname.ads +++ b/gcc/ada/fname.ads @@ -68,12 +68,14 @@ package Fname is (Fname : File_Name_Type; Renamings_Included : Boolean := True) return Boolean; -- This function determines if the given file name (which must be a simple - -- file name with no directory information) is the file name for one of - -- the predefined library units. On return, Name_Buffer contains the - -- file name. The Renamings_Included parameter indicates whether annex - -- J renamings such as Text_IO are to be considered as predefined. If - -- Renamings_Included is True, then Text_IO will return True, otherwise - -- only children of Ada, Interfaces and System return True. + -- file name with no directory information) is the file name for one of the + -- predefined library units (i.e. part of the Ada, System, or Interface + -- hierarchies). Note that units in the GNAT hierarchy are not considered + -- predefined (see Is_Internal_File_Name below). On return, Name_Buffer + -- contains the file name. The Renamings_Included parameter indicates + -- whether annex J renamings such as Text_IO are to be considered as + -- predefined. If Renamings_Included is True, then Text_IO will return + -- True, otherwise only children of Ada, Interfaces and System return True. function Is_Predefined_File_Name (Renamings_Included : Boolean := True) return Boolean; @@ -82,9 +84,9 @@ package Fname is function Is_Internal_File_Name (Fname : File_Name_Type; Renamings_Included : Boolean := True) return Boolean; - -- Similar to Is_Predefined_File_Name. The internal file set is a - -- superset of the predefined file set including children of GNAT, - -- and also children of DEC for the VMS case. + -- Similar to Is_Predefined_File_Name. The internal file set is a superset + -- of the predefined file set including children of GNAT, and also children + -- of DEC for the VMS case. procedure Tree_Read; -- Dummy procedure (reads dummy table values from tree file) diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index f977e7a0e02..edd52f5b7f0 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -155,14 +155,8 @@ package body Freeze is -- setting of Debug_Info_Needed for the entity. This flag is set if -- the entity comes from source, or if we are in Debug_Generated_Code -- mode or if the -gnatdV debug flag is set. However, it never sets - -- the flag if Debug_Info_Off is set. - - procedure Set_Debug_Info_Needed (T : Entity_Id); - -- Sets the Debug_Info_Needed flag on entity T if not already set, and - -- also on any entities that are needed by T (for an object, the type - -- of the object is needed, and for a type, the subsidiary types are - -- needed -- see body for details). Never has any effect on T if the - -- Debug_Info_Off flag is set. + -- the flag if Debug_Info_Off is set. This procedure also ensures that + -- subsidiary entities have the flag set as required. procedure Undelay_Type (T : Entity_Id); -- T is a type of a component that we know to be an Itype. @@ -956,12 +950,13 @@ package body Freeze is procedure Check_Debug_Info_Needed (T : Entity_Id) is begin - if Needs_Debug_Info (T) or else Debug_Info_Off (T) then + if Debug_Info_Off (T) then return; elsif Comes_From_Source (T) or else Debug_Generated_Code or else Debug_Flag_VV + or else Needs_Debug_Info (T) then Set_Debug_Info_Needed (T); end if; @@ -1856,7 +1851,7 @@ package body Freeze is then declare Will_Be_Frozen : Boolean := False; - S : Entity_Id := Scope (Rec); + S : Entity_Id; begin -- We have a pretty bad kludge here. Suppose Rec is subtype @@ -1874,6 +1869,7 @@ package body Freeze is -- do, then mark that Comp'Base will actually be frozen. If -- so, we merely undelay it. + S := Scope (Rec); while Present (S) loop if Is_Subprogram (S) then Will_Be_Frozen := True; @@ -1994,14 +1990,31 @@ package body Freeze is end if; end if; + -- Set OK_To_Reorder_Components depending on debug flags + + if Rec = Base_Type (Rec) + and then Convention (Rec) = Convention_Ada + then + if (Has_Discriminants (Rec) and then Debug_Flag_Dot_V) + or else + (not Has_Discriminants (Rec) and then Debug_Flag_Dot_R) + then + Set_OK_To_Reorder_Components (Rec); + end if; + end if; + -- Check for useless pragma Pack when all components placed. We only -- do this check for record types, not subtypes, since a subtype may -- have all its components placed, and it still makes perfectly good - -- sense to pack other subtypes or the parent type. + -- sense to pack other subtypes or the parent type. We do not give + -- this warning if Optimize_Alignment is set to Space, since the + -- pragma Pack does have an effect in this case (it always resets + -- the alignment to one). if Ekind (Rec) = E_Record_Type and then Is_Packed (Rec) and then not Unplaced_Component + and then Optimize_Alignment /= 'S' then -- Reset packed status. Probably not necessary, but we do it so -- that there is no chance of the back end doing something strange @@ -2093,16 +2106,19 @@ package body Freeze is -- Generate warning for applying C or C++ convention to a record -- with discriminants. This is suppressed for the unchecked union - -- case, since the whole point in this case is interface C. + -- case, since the whole point in this case is interface C. We also + -- do not generate this within instantiations, since we will have + -- generated a message on the template. if Has_Discriminants (E) and then not Is_Unchecked_Union (E) - and then not Warnings_Off (E) - and then not Warnings_Off (Base_Type (E)) and then (Convention (E) = Convention_C or else Convention (E) = Convention_CPP) and then Comes_From_Source (E) + and then not In_Instance + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (Base_Type (E)) then declare Cprag : constant Node_Id := Get_Rep_Pragma (E, Name_Convention); @@ -2330,16 +2346,18 @@ package body Freeze is end if; -- Check suspicious parameter for C function. These tests - -- apply only to exported/imported suboprograms. + -- apply only to exported/imported subprograms. if Warn_On_Export_Import + and then Comes_From_Source (E) and then (Convention (E) = Convention_C or else Convention (E) = Convention_CPP) - and then not Warnings_Off (E) - and then not Warnings_Off (F_Type) - and then not Warnings_Off (Formal) and then (Is_Imported (E) or else Is_Exported (E)) + and then Convention (E) /= Convention (Formal) + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (F_Type) + and then not Has_Warnings_Off (Formal) then Error_Msg_Qual_Level := 1; @@ -2482,14 +2500,14 @@ package body Freeze is and then (Convention (E) = Convention_C or else Convention (E) = Convention_CPP) - and then not Warnings_Off (E) - and then not Warnings_Off (R_Type) and then (Is_Imported (E) or else Is_Exported (E)) then -- Check suspicious return of fat C pointer if Is_Access_Type (R_Type) and then Esize (R_Type) > Ttypes.System_Address_Size + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (R_Type) then Error_Msg_N ("?return type of& does not " @@ -2499,6 +2517,8 @@ package body Freeze is elsif Root_Type (R_Type) = Standard_Boolean and then Convention (R_Type) = Convention_Ada + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (R_Type) then Error_Msg_N ("?return type of & is an 8-bit " @@ -2512,6 +2532,8 @@ package body Freeze is Is_Tagged_Type (Designated_Type (R_Type)))) and then Convention (E) = Convention_C + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (R_Type) then Error_Msg_N ("?return type of & does not " @@ -2521,6 +2543,8 @@ package body Freeze is elsif Ekind (R_Type) = E_Access_Subprogram_Type and then not Has_Foreign_Convention (R_Type) + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (R_Type) then Error_Msg_N ("?& should return a foreign " @@ -2537,10 +2561,12 @@ package body Freeze is and then not Is_Imported (E) and then Has_Foreign_Convention (E) and then Warn_On_Export_Import + and then not Has_Warnings_Off (E) + and then not Has_Warnings_Off (Etype (E)) then Error_Msg_N ("?foreign convention function& should not " & - "return unconstrained array", E); + "return unconstrained array!", E); -- Ada 2005 (AI-326): Check wrong use of tagged -- incomplete type @@ -5233,7 +5259,6 @@ package body Freeze is Next_Formal (Formal); end loop; - end Process_Default_Expressions; ---------------------------------------- @@ -5266,65 +5291,6 @@ package body Freeze is end if; end Set_Component_Alignment_If_Not_Set; - --------------------------- - -- Set_Debug_Info_Needed -- - --------------------------- - - procedure Set_Debug_Info_Needed (T : Entity_Id) is - begin - if No (T) - or else Needs_Debug_Info (T) - or else Debug_Info_Off (T) - then - return; - else - Set_Needs_Debug_Info (T); - end if; - - if Is_Object (T) then - Set_Debug_Info_Needed (Etype (T)); - - elsif Is_Type (T) then - Set_Debug_Info_Needed (Etype (T)); - - if Is_Record_Type (T) then - declare - Ent : Entity_Id := First_Entity (T); - begin - while Present (Ent) loop - Set_Debug_Info_Needed (Ent); - Next_Entity (Ent); - end loop; - end; - - elsif Is_Array_Type (T) then - Set_Debug_Info_Needed (Component_Type (T)); - - declare - Indx : Node_Id := First_Index (T); - begin - while Present (Indx) loop - Set_Debug_Info_Needed (Etype (Indx)); - Indx := Next_Index (Indx); - end loop; - end; - - if Is_Packed (T) then - Set_Debug_Info_Needed (Packed_Array_Type (T)); - end if; - - elsif Is_Access_Type (T) then - Set_Debug_Info_Needed (Directly_Designated_Type (T)); - - elsif Is_Private_Type (T) then - Set_Debug_Info_Needed (Full_View (T)); - - elsif Is_Protected_Type (T) then - Set_Debug_Info_Needed (Corresponding_Record_Type (T)); - end if; - end if; - end Set_Debug_Info_Needed; - ------------------ -- Undelay_Type -- ------------------ @@ -5439,7 +5405,7 @@ package body Freeze is if Present (Decl) and then Nkind (Decl) = N_Pragma - and then Chars (Decl) = Name_Import + and then Pragma_Name (Decl) = Name_Import then return; end if; diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index dc1d469f0c2..6d01843fb22 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -59,8 +59,8 @@ with Tbuild; use Tbuild; with Types; use Types; procedure Frontend is - Config_Pragmas : List_Id; - -- Gather configuration pragmas + Config_Pragmas : List_Id; + -- Gather configuration pragmas begin -- Carry out package initializations. These are initializations which @@ -78,6 +78,7 @@ begin Sem_Ch8.Initialize; Fname.UF.Initialize; Checks.Initialize; + Sem_Warn.Initialize; -- Create package Standard @@ -207,6 +208,14 @@ begin Fmap.Initialize (Mapping_File_Name.all); end if; + -- Adjust Optimize_Alignment mode from debug switches if necessary + + if Debug_Flag_Dot_SS then + Optimize_Alignment := 'S'; + elsif Debug_Flag_Dot_TT then + Optimize_Alignment := 'T'; + end if; + -- We have now processed the command line switches, and the gnat.adc -- file, so this is the point at which we want to capture the values -- of the configuration switches (see Opt for further details). @@ -326,6 +335,7 @@ begin Sem_Warn.Output_Non_Modifed_In_Out_Warnings; Sem_Warn.Output_Unreferenced_Messages; Sem_Warn.Check_Unused_Withs; + Sem_Warn.Output_Unused_Warnings_Off_Warnings; end if; end if; diff --git a/gcc/ada/g-altive.ads b/gcc/ada/g-altive.ads index 5951358fada..bbfd0f51c3c 100644 --- a/gcc/ada/g-altive.ads +++ b/gcc/ada/g-altive.ads @@ -345,7 +345,7 @@ package GNAT.Altivec is -- support of the target. Note that this means that there may be -- minor differences in results between targets when the floating- -- point implementations are slightly different, as would happen - -- with normal non-altivec floating-point operations. In particular + -- with normal non-Altivec floating-point operations. In particular -- the Altivec simulations may yield slightly different results -- from those obtained on a true hardware Altivec target if the -- floating-point implementation is not 100% compatible. diff --git a/gcc/ada/g-byorma.adb b/gcc/ada/g-byorma.adb index 9cc6f08b519..6bbaedf8b71 100755 --- a/gcc/ada/g-byorma.adb +++ b/gcc/ada/g-byorma.adb @@ -44,27 +44,13 @@ package body GNAT.Byte_Order_Mark is XML_Support : Boolean := False) is begin - -- UTF-16 (big-endian) - - if Str'Length >= 2 - and then Str (Str'First) = Character'Val (16#FE#) - and then Str (Str'First + 1) = Character'Val (16#FF#) - then - Len := 2; - BOM := UTF16_BE; - - -- UTF-16 (little-endian) - - elsif Str'Length >= 2 - and then Str (Str'First) = Character'Val (16#FF#) - and then Str (Str'First + 1) = Character'Val (16#FE#) - then - Len := 2; - BOM := UTF16_LE; + -- Note: the order of these tests is important, because in some cases + -- one sequence is a prefix of a longer sequence, and we must test for + -- the longer sequence first -- UTF-32 (big-endian) - elsif Str'Length >= 4 + if Str'Length >= 4 and then Str (Str'First) = Character'Val (16#00#) and then Str (Str'First + 1) = Character'Val (16#00#) and then Str (Str'First + 2) = Character'Val (16#FE#) @@ -84,6 +70,23 @@ package body GNAT.Byte_Order_Mark is Len := 4; BOM := UTF32_LE; + -- UTF-16 (big-endian) + + elsif Str'Length >= 2 + and then Str (Str'First) = Character'Val (16#FE#) + and then Str (Str'First + 1) = Character'Val (16#FF#) + then + Len := 2; + BOM := UTF16_BE; + + -- UTF-16 (little-endian) + + elsif Str'Length >= 2 + and then Str (Str'First) = Character'Val (16#FF#) + and then Str (Str'First + 1) = Character'Val (16#FE#) + then + Len := 2; + BOM := UTF16_LE; -- UTF-8 (endian-independent) elsif Str'Length >= 3 diff --git a/gcc/ada/g-catiio.adb b/gcc/ada/g-catiio.adb index 3a6bc398391..f7b318edbe3 100644 --- a/gcc/ada/g-catiio.adb +++ b/gcc/ada/g-catiio.adb @@ -536,7 +536,7 @@ package body GNAT.Calendar.Time_IO is constant array (Ada.Calendar.Month_Number) of String3 := ("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"); - -- Short version of the month names, used when parsing date strings. + -- Short version of the month names, used when parsing date strings S : String := Str; diff --git a/gcc/ada/g-catiio.ads b/gcc/ada/g-catiio.ads index 5c2cbf9834f..34a38878c9f 100644 --- a/gcc/ada/g-catiio.ads +++ b/gcc/ada/g-catiio.ads @@ -125,10 +125,12 @@ package GNAT.Calendar.Time_IO is -- The following formats are also supported. They all accept an optional -- time with the format "hh:mm:ss". The time is separated from the date by -- exactly one space character. + -- -- When the time is not specified, it is set to 00:00:00. The delimiter '*' -- must be either '-' and '/' and both occurrences must use the same -- character. - -- Trailing characters (in particular spaces) are not allowed. + -- + -- Trailing characters (in particular spaces) are not allowed -- -- yyyy*mm*dd -- yy*mm*dd - Year is assumed to be 20yy @@ -145,8 +147,7 @@ package GNAT.Calendar.Time_IO is procedure Put_Time (Date : Ada.Calendar.Time; Picture : Picture_String); - -- Put Date with format Picture. Raise Picture_Error if picture string is - -- wrong + -- Put Date with format Picture. Raise Picture_Error if bad picture string private ISO_Date : constant Picture_String := "%Y-%m-%d"; diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb index 774444d0826..0cccaba2cd2 100644 --- a/gcc/ada/g-dirope.adb +++ b/gcc/ada/g-dirope.adb @@ -46,10 +46,6 @@ package body GNAT.Directory_Operations is use Ada; - type Dir_Type_Value is new System.Address; - -- This is the low-level address directory structure as returned by the C - -- opendir routine. - Filename_Max : constant Integer := 1024; -- 1024 is the value of FILENAME_MAX in stdio.h diff --git a/gcc/ada/g-dirope.ads b/gcc/ada/g-dirope.ads index 060c3c439d9..c489eccdedc 100644 --- a/gcc/ada/g-dirope.ads +++ b/gcc/ada/g-dirope.ads @@ -43,6 +43,7 @@ -- directory names (OpenVMS native directory format is not supported). -- Read individual entries for more specific notes on OpenVMS support. +with System; with Ada.Strings.Maps; package GNAT.Directory_Operations is @@ -254,7 +255,15 @@ package GNAT.Directory_Operations is private - type Dir_Type_Value; + type Dir_Type_Value is new System.Address; + -- Low-level address directory structure as returned by opendir in C + -- + -- Note that we used to define this type in the body of this package, + -- but this was causing troubles in the context of .NET code generation + -- (because Taft amendment types are not fully implemented and cause + -- undefined references to the class), so we moved the type declaration + -- to the spec's private part, which is no problem in any case here. + type Dir_Type is access Dir_Type_Value; Null_Dir : constant Dir_Type := null; diff --git a/gcc/ada/g-pehage.adb b/gcc/ada/g-pehage.adb index 6d9670f69f8..f64181e1eb8 100644 --- a/gcc/ada/g-pehage.adb +++ b/gcc/ada/g-pehage.adb @@ -31,7 +31,6 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Exceptions; use Ada.Exceptions; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with GNAT.Heap_Sort_G; @@ -1218,8 +1217,7 @@ package body GNAT.Perfect_Hash_Generators is end if; if C not in '0' .. '9' then - Raise_Exception - (Program_Error'Identity, "cannot read position argument"); + raise Program_Error with "cannot read position argument"; end if; while C in '0' .. '9' loop @@ -1271,8 +1269,7 @@ package body GNAT.Perfect_Hash_Generators is exit when L < N; if Argument (N) /= ',' then - Raise_Exception - (Program_Error'Identity, "cannot read position argument"); + raise Program_Error with "cannot read position argument"; end if; N := N + 1; @@ -2184,8 +2181,7 @@ package body GNAT.Perfect_Hash_Generators is end loop; if Old_Differences = Max_Differences then - Raise_Exception - (Program_Error'Identity, "some keys are identical"); + raise Program_Error with "some keys are identical"; end if; -- Insert selected position and sort Sel_Position table diff --git a/gcc/ada/g-regist.adb b/gcc/ada/g-regist.adb index ec0d974e743..8eaa4081bbc 100644 --- a/gcc/ada/g-regist.adb +++ b/gcc/ada/g-regist.adb @@ -30,14 +30,12 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Exceptions; with Interfaces.C; with System; with GNAT.Directory_Operations; package body GNAT.Registry is - use Ada; use System; ------------------------------ @@ -156,9 +154,8 @@ package body GNAT.Registry is use type LONG; begin if Result /= ERROR_SUCCESS then - Exceptions.Raise_Exception - (Registry_Error'Identity, - Message & " (" & LONG'Image (Result) & ')'); + raise Registry_Error with + Message & " (" & LONG'Image (Result) & ')'; end if; end Check_Result; diff --git a/gcc/ada/g-sercom-linux.adb b/gcc/ada/g-sercom-linux.adb new file mode 100644 index 00000000000..bcb5952f529 --- /dev/null +++ b/gcc/ada/g-sercom-linux.adb @@ -0,0 +1,289 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- G N A T . S E R I A L _ C O M M U N I C A T I O N S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2007-2008, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the GNU/Linux implementation of this package + +with Ada.Streams; use Ada.Streams; +with Ada; use Ada; +with Ada.Unchecked_Deallocation; + +with System.CRTL; use System, System.CRTL; + +with GNAT.OS_Lib; use GNAT.OS_Lib; + +package body GNAT.Serial_Communications is + + type Port_Data is new int; + + subtype unsigned is Interfaces.C.unsigned; + subtype char is Interfaces.C.char; + subtype unsigned_char is Interfaces.C.unsigned_char; + + function fcntl (fd : int; cmd : int; value : int) return int; + pragma Import (C, fcntl, "fcntl"); + + O_RDWR : constant := 8#02#; + O_NOCTTY : constant := 8#0400#; + O_NDELAY : constant := 8#04000#; + FNDELAY : constant := O_NDELAY; + F_SETFL : constant := 4; + TCSANOW : constant := 0; + TCIFLUSH : constant := 0; + CLOCAL : constant := 8#04000#; + CREAD : constant := 8#0200#; + CSTOPB : constant := 8#0100#; + CRTSCTS : constant := 8#020000000000#; + + -- c_cc indexes + + VTIME : constant := 5; + VMIN : constant := 6; + + C_Data_Rate : constant array (Data_Rate) of unsigned := + (B1200 => 8#000011#, + B2400 => 8#000013#, + B4800 => 8#000014#, + B9600 => 8#000015#, + B19200 => 8#000016#, + B38400 => 8#000017#, + B57600 => 8#010001#); + + C_Bits : constant array (Data_Bits) of unsigned := + (B7 => 8#040#, B8 => 8#060#); + + procedure Raise_Error (Message : String; Error : Integer := Errno); + pragma No_Return (Raise_Error); + + ---------- + -- Name -- + ---------- + + function Name (Number : Positive) return Port_Name is + N : constant Natural := Number - 1; + N_Img : constant String := Natural'Image (N); + begin + return Port_Name ("/dev/ttyS" & N_Img (N_Img'First + 1 .. N_Img'Last)); + end Name; + + ---------- + -- Open -- + ---------- + + procedure Open + (Port : out Serial_Port; + Name : Port_Name) + is + C_Name : constant String := String (Name) & ASCII.NUL; + Res : int; + + begin + if Port.H = null then + Port.H := new Port_Data; + end if; + + Port.H.all := Port_Data (open + (C_Name (C_Name'First)'Address, int (O_RDWR + O_NOCTTY + O_NDELAY))); + + if Port.H.all = -1 then + Raise_Error ("open: open failed"); + end if; + + -- By default we are in blocking mode + + Res := fcntl (int (Port.H.all), F_SETFL, 0); + + if Res = -1 then + Raise_Error ("open: fcntl failed"); + end if; + end Open; + + ----------------- + -- Raise_Error -- + ----------------- + + procedure Raise_Error (Message : String; Error : Integer := Errno) is + begin + raise Serial_Error with Message & " (" & Integer'Image (Error) & ')'; + end Raise_Error; + + ---------- + -- Read -- + ---------- + + overriding procedure Read + (Port : in out Serial_Port; + Buffer : out Stream_Element_Array; + Last : out Stream_Element_Offset) + is + Len : constant int := Buffer'Length; + Res : int; + + begin + if Port.H = null then + Raise_Error ("read: port not opened", 0); + end if; + + Res := read (Integer (Port.H.all), Buffer'Address, Len); + + if Res = -1 then + Last := 0; + Raise_Error ("read failed"); + else + Last := Buffer'First + Stream_Element_Offset (Res) - 1; + end if; + end Read; + + --------- + -- Set -- + --------- + + procedure Set + (Port : Serial_Port; + Rate : Data_Rate := B9600; + Bits : Data_Bits := B8; + Block : Boolean := True; + Timeout : Integer := 10) + is + use type unsigned; + + type termios is record + c_iflag : unsigned; + c_oflag : unsigned; + c_cflag : unsigned; + c_lflag : unsigned; + c_line : unsigned_char; + c_cc : Interfaces.C.char_array (0 .. 31); + c_ispeed : unsigned; + c_ospeed : unsigned; + end record; + pragma Convention (C, termios); + + function tcgetattr (fd : int; termios_p : Address) return int; + pragma Import (C, tcgetattr, "tcgetattr"); + + function tcsetattr + (fd : int; action : int; termios_p : Address) return int; + pragma Import (C, tcsetattr, "tcsetattr"); + + function tcflush (fd : int; queue_selector : int) return int; + pragma Import (C, tcflush, "tcflush"); + + Current : termios; + Res : int; + + begin + if Port.H = null then + Raise_Error ("set: port not opened", 0); + end if; + + -- Get current port settings + + Res := tcgetattr (int (Port.H.all), Current'Address); + + -- Change settings now + + Current.c_cflag := C_Data_Rate (Rate) + or C_Bits (Bits) + or CLOCAL + or CREAD + or CSTOPB + or CRTSCTS; + Current.c_lflag := 0; + Current.c_iflag := 0; + Current.c_oflag := 0; + Current.c_ispeed := Data_Rate_Value (Rate); + Current.c_ospeed := Data_Rate_Value (Rate); + Current.c_cc (VMIN) := char'Val (0); + Current.c_cc (VTIME) := char'Val (Timeout); + + -- Set port settings + + Res := tcflush (int (Port.H.all), TCIFLUSH); + Res := tcsetattr (int (Port.H.all), TCSANOW, Current'Address); + + -- Block + + if Block then + Res := fcntl (int (Port.H.all), F_SETFL, 0); + else + Res := fcntl (int (Port.H.all), F_SETFL, FNDELAY); + end if; + + if Res = -1 then + Raise_Error ("set: fcntl failed"); + end if; + end Set; + + ----------- + -- Write -- + ----------- + + overriding procedure Write + (Port : in out Serial_Port; + Buffer : Stream_Element_Array) + is + Len : constant int := Buffer'Length; + Res : int; + + begin + if Port.H = null then + Raise_Error ("write: port not opened", 0); + end if; + + Res := write (int (Port.H.all), Buffer'Address, Len); + pragma Assert (Res = Len); + + if Res = -1 then + Raise_Error ("write failed"); + end if; + end Write; + + ----------- + -- Close -- + ----------- + + procedure Close (Port : in out Serial_Port) is + procedure Unchecked_Free is + new Unchecked_Deallocation (Port_Data, Port_Data_Access); + + Res : int; + pragma Unreferenced (Res); + + begin + if Port.H /= null then + Res := close (int (Port.H.all)); + Unchecked_Free (Port.H); + end if; + end Close; + +end GNAT.Serial_Communications; diff --git a/gcc/ada/g-sercom-mingw.adb b/gcc/ada/g-sercom-mingw.adb new file mode 100644 index 00000000000..5cb6e455cfc --- /dev/null +++ b/gcc/ada/g-sercom-mingw.adb @@ -0,0 +1,413 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- G N A T . S E R I A L _ C O M M U N I C A T I O N S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2007-2008, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the Windows implementation of this package + +with Ada.Unchecked_Deallocation; use Ada; +with Ada.Streams; use Ada.Streams; +with System; use System; + +package body GNAT.Serial_Communications is + + -- Common types + + type HANDLE is new Interfaces.C.long; + type DWORD is new Interfaces.C.unsigned_long; + type WORD is new Interfaces.C.unsigned_short; + subtype PVOID is System.Address; + type BOOL is new Boolean; + for BOOL'Size use Interfaces.C.unsigned_long'Size; + type BYTE is new Interfaces.C.unsigned_char; + subtype CHAR is Interfaces.C.char; + + type Port_Data is new HANDLE; + + type Bits1 is range 0 .. 2 ** 1 - 1; + type Bits2 is range 0 .. 2 ** 2 - 1; + type Bits17 is range 0 .. 2 ** 17 - 1; + for Bits1'Size use 1; + for Bits2'Size use 2; + for Bits17'Size use 17; + + ----------- + -- Files -- + ----------- + + function GetLastError return DWORD; + pragma Import (Stdcall, GetLastError, "GetLastError"); + + GENERIC_READ : constant := 16#80000000#; + GENERIC_WRITE : constant := 16#40000000#; + OPEN_EXISTING : constant := 3; + + type OVERLAPPED is record + Internal : DWORD; + InternalHigh : DWORD; + Offset : DWORD; + OffsetHigh : DWORD; + hEvent : HANDLE; + end record; + + type SECURITY_ATTRIBUTES is record + nLength : DWORD; + pSecurityDescriptor : PVOID; + bInheritHandle : BOOL; + end record; + + function CreateFile + (lpFileName : Address; + dwDesiredAccess : DWORD; + dwShareMode : DWORD; + lpSecurityAttributes : access SECURITY_ATTRIBUTES; + dwCreationDisposition : DWORD; + dwFlagsAndAttributes : DWORD; + hTemplateFile : HANDLE) return HANDLE; + pragma Import (Stdcall, CreateFile, "CreateFileA"); + + function WriteFile + (hFile : HANDLE; + lpBuffer : Address; + nNumberOfBytesToWrite : DWORD; + lpNumberOfBytesWritten : access DWORD; + lpOverlapped : access OVERLAPPED) return BOOL; + pragma Import (Stdcall, WriteFile, "WriteFile"); + + function ReadFile + (hFile : HANDLE; + lpBuffer : Address; + nNumberOfBytesToRead : DWORD; + lpNumberOfBytesRead : access DWORD; + lpOverlapped : access OVERLAPPED) return BOOL; + pragma Import (Stdcall, ReadFile, "ReadFile"); + + function CloseHandle (hObject : HANDLE) return BOOL; + pragma Import (Stdcall, CloseHandle, "CloseHandle"); + + DTR_CONTROL_DISABLE : constant := 16#0#; + RTS_CONTROL_DISABLE : constant := 16#0#; + ODDPARITY : constant := 1; + ONESTOPBIT : constant := 0; + + type DCB is record + DCBLENGTH : DWORD; + BaudRate : DWORD; + fBinary : Bits1; + fParity : Bits1; + fOutxCtsFlow : Bits1; + fOutxDsrFlow : Bits1; + fDtrControl : Bits2; + fDsrSensitivity : Bits1; + fTXContinueOnXoff : Bits1; + fOutX : Bits1; + fInX : Bits1; + fErrorChar : Bits1; + fNull : Bits1; + fRtsControl : Bits2; + fAbortOnError : Bits1; + fDummy2 : Bits17; + wReserved : WORD; + XonLim : WORD; + XoffLim : WORD; + ByteSize : BYTE; + Parity : BYTE; + StopBits : BYTE; + XonChar : CHAR; + XoffChar : CHAR; + ErrorChar : CHAR; + EofChar : CHAR; + EvtChar : CHAR; + wReserved1 : WORD; + end record; + pragma Convention (C, DCB); + + for DCB use record + DCBLENGTH at 0 range 0 .. 31; + BaudRate at 4 range 0 .. 31; + fBinary at 8 range 0 .. 0; + fParity at 8 range 1 .. 1; + fOutxCtsFlow at 8 range 2 .. 2; + fOutxDsrFlow at 8 range 3 .. 3; + fDtrControl at 8 range 4 .. 5; + fDsrSensitivity at 8 range 6 .. 6; + fTXContinueOnXoff at 8 range 7 .. 7; + fOutX at 9 range 0 .. 0; + fInX at 9 range 1 .. 1; + fErrorChar at 9 range 2 .. 2; + fNull at 9 range 3 .. 3; + fRtsControl at 9 range 4 .. 5; + fAbortOnError at 9 range 6 .. 6; + fDummy2 at 9 range 7 .. 23; + wReserved at 12 range 0 .. 15; + XonLim at 14 range 0 .. 15; + XoffLim at 16 range 0 .. 15; + ByteSize at 18 range 0 .. 7; + Parity at 19 range 0 .. 7; + StopBits at 20 range 0 .. 7; + XonChar at 21 range 0 .. 7; + XoffChar at 22 range 0 .. 7; + ErrorChar at 23 range 0 .. 7; + EofChar at 24 range 0 .. 7; + EvtChar at 25 range 0 .. 7; + wReserved1 at 26 range 0 .. 15; + end record; + + type COMMTIMEOUTS is record + ReadIntervalTimeout : DWORD; + ReadTotalTimeoutMultiplier : DWORD; + ReadTotalTimeoutConstant : DWORD; + WriteTotalTimeoutMultiplier : DWORD; + WriteTotalTimeoutConstant : DWORD; + end record; + pragma Convention (C, COMMTIMEOUTS); + + function GetCommState + (hFile : HANDLE; + lpDCB : access DCB) return BOOL; + pragma Import (Stdcall, GetCommState, "GetCommState"); + + function SetCommState + (hFile : HANDLE; + lpDCB : access DCB) return BOOL; + pragma Import (Stdcall, SetCommState, "SetCommState"); + + function SetCommTimeouts + (hFile : HANDLE; + lpCommTimeouts : access COMMTIMEOUTS) return BOOL; + pragma Import (Stdcall, SetCommTimeouts, "SetCommTimeouts"); + + procedure Raise_Error (Message : String; Error : DWORD := GetLastError); + pragma No_Return (Raise_Error); + + ----------- + -- Close -- + ----------- + + procedure Close (Port : in out Serial_Port) is + procedure Unchecked_Free is + new Unchecked_Deallocation (Port_Data, Port_Data_Access); + + Success : BOOL; + + begin + if Port.H /= null then + Success := CloseHandle (HANDLE (Port.H.all)); + Unchecked_Free (Port.H); + if not Success then + Raise_Error ("error closing the port"); + end if; + end if; + end Close; + + ---------- + -- Name -- + ---------- + + function Name (Number : Positive) return Port_Name is + N_Img : constant String := Positive'Image (Number); + begin + return Port_Name ("COM" & N_Img (N_Img'First + 1 .. N_Img'Last) & ':'); + end Name; + + ---------- + -- Open -- + ---------- + + procedure Open + (Port : out Serial_Port; + Name : Port_Name) + is + C_Name : constant String := String (Name) & ASCII.NUL; + Success : BOOL; + pragma Unreferenced (Success); + + begin + if Port.H = null then + Port.H := new Port_Data; + else + Success := CloseHandle (HANDLE (Port.H.all)); + end if; + + Port.H.all := Port_Data (CreateFile + (lpFileName => C_Name (C_Name'First)'Address, + dwDesiredAccess => GENERIC_READ or GENERIC_WRITE, + dwShareMode => 0, + lpSecurityAttributes => null, + DwCreationDisposition => OPEN_EXISTING, + dwFlagsAndAttributes => 0, + HTemplateFile => 0)); + + if Port.H.all = 0 then + Raise_Error ("cannot open com port"); + end if; + end Open; + + ----------------- + -- Raise_Error -- + ----------------- + + procedure Raise_Error (Message : String; Error : DWORD := GetLastError) is + begin + raise Serial_Error with Message & " (" & DWORD'Image (Error) & ')'; + end Raise_Error; + + ---------- + -- Read -- + ---------- + + overriding procedure Read + (Port : in out Serial_Port; + Buffer : out Stream_Element_Array; + Last : out Stream_Element_Offset) + is + Success : BOOL; + Read_Last : aliased DWORD; + + begin + if Port.H = null then + Raise_Error ("read: port not opened", 0); + end if; + + Success := ReadFile + (hFile => HANDLE (Port.H.all), + lpBuffer => Buffer (Buffer'First)'Address, + nNumberOfBytesToRead => DWORD (Buffer'Length), + lpNumberOfBytesRead => Read_Last'Access, + lpOverlapped => null); + + if not Success then + Raise_Error ("read error"); + end if; + + Last := Buffer'First - 1 + Stream_Element_Offset (Read_Last); + end Read; + + --------- + -- Set -- + --------- + + procedure Set + (Port : Serial_Port; + Rate : Data_Rate := B9600; + Bits : Data_Bits := B8; + Block : Boolean := True; + Timeout : Integer := 10) + is + Success : BOOL; + Com_Time_Out : aliased COMMTIMEOUTS; + Com_Settings : aliased DCB; + + begin + if Port.H = null then + Raise_Error ("set: port not opened", 0); + end if; + + Success := GetCommState (HANDLE (Port.H.all), Com_Settings'Access); + + if not Success then + Success := CloseHandle (HANDLE (Port.H.all)); + Port.H.all := 0; + Raise_Error ("set: cannot get comm state"); + end if; + + Com_Settings.BaudRate := DWORD (Data_Rate_Value (Rate)); + Com_Settings.fParity := 1; + Com_Settings.fOutxCtsFlow := 0; + Com_Settings.fOutxDsrFlow := 0; + Com_Settings.fDsrSensitivity := 0; + Com_Settings.fDtrControl := DTR_CONTROL_DISABLE; + Com_Settings.fOutX := 0; + Com_Settings.fInX := 0; + Com_Settings.fRtsControl := RTS_CONTROL_DISABLE; + Com_Settings.fAbortOnError := 0; + Com_Settings.ByteSize := BYTE (Bit_Value (Bits)); + Com_Settings.Parity := ODDPARITY; + Com_Settings.StopBits := ONESTOPBIT; + + Success := SetCommState (HANDLE (Port.H.all), Com_Settings'Access); + + if not Success then + Success := CloseHandle (HANDLE (Port.H.all)); + Port.H.all := 0; + Raise_Error ("cannot set comm state"); + end if; + + -- Set the timeout status + + if Block then + Com_Time_Out := (others => 0); + else + Com_Time_Out := + (ReadTotalTimeoutConstant => DWORD (1000 * Timeout), + others => 0); + end if; + + Success := SetCommTimeouts + (hFile => HANDLE (Port.H.all), + lpCommTimeouts => Com_Time_Out'Access); + + if not Success then + Raise_Error ("cannot set the timeout"); + end if; + end Set; + + ----------- + -- Write -- + ----------- + + overriding procedure Write + (Port : in out Serial_Port; + Buffer : Stream_Element_Array) + is + Success : BOOL; + Temp_Last : aliased DWORD; + + begin + if Port.H = null then + Raise_Error ("write: port not opened", 0); + end if; + + Success := WriteFile + (hFile => HANDLE (Port.H.all), + lpBuffer => Buffer'Address, + nNumberOfBytesToWrite => DWORD (Buffer'Length), + lpNumberOfBytesWritten => Temp_Last'Access, + lpOverlapped => null); + + if not Boolean (Success) + or else Stream_Element_Offset (Temp_Last) /= Buffer'Length + then + Raise_Error ("failed to write data"); + end if; + end Write; + +end GNAT.Serial_Communications; diff --git a/gcc/ada/g-sercom.adb b/gcc/ada/g-sercom.adb new file mode 100644 index 00000000000..920557b2643 --- /dev/null +++ b/gcc/ada/g-sercom.adb @@ -0,0 +1,131 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- G N A T . S E R I A L _ C O M M U N I C A T I O N S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2007, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- Default version of this package + +with Ada.Streams; use Ada.Streams; + +package body GNAT.Serial_Communications is + + pragma Warnings (Off); + -- Kill warnings on unreferenced formals + + type Port_Data is new Integer; + + ----------------------- + -- Local Subprograms -- + ----------------------- + + procedure Unimplemented; + pragma No_Return (Unimplemented); + -- This procedure raises a Program_Error with an appropriate message + -- indicating that an unimplemented feature has been used. + + ---------- + -- Name -- + ---------- + + function Name (Number : Positive) return Port_Name is + begin + Unimplemented; + return ""; + end Name; + + ---------- + -- Open -- + ---------- + + procedure Open + (Port : out Serial_Port; + Name : Port_Name) is + begin + Unimplemented; + end Open; + + --------- + -- Set -- + --------- + + procedure Set + (Port : Serial_Port; + Rate : Data_Rate := B9600; + Bits : Data_Bits := B8; + Block : Boolean := True; + Timeout : Integer := 10) is + begin + Unimplemented; + end Set; + + ---------- + -- Read -- + ---------- + + overriding procedure Read + (Port : in out Serial_Port; + Buffer : out Stream_Element_Array; + Last : out Stream_Element_Offset) is + begin + Unimplemented; + end Read; + + ----------- + -- Write -- + ----------- + + overriding procedure Write + (Port : in out Serial_Port; + Buffer : Stream_Element_Array) is + begin + Unimplemented; + end Write; + + ----------- + -- Close -- + ----------- + + procedure Close (Port : in out Serial_Port) is + begin + Unimplemented; + end Close; + + ------------------- + -- Unimplemented; -- + ------------------- + + procedure Unimplemented is + begin + raise Program_Error + with "Serial_Communications not implemented"; + end Unimplemented; + +end GNAT.Serial_Communications; diff --git a/gcc/ada/g-sercom.ads b/gcc/ada/g-sercom.ads new file mode 100644 index 00000000000..bbd8f91e331 --- /dev/null +++ b/gcc/ada/g-sercom.ads @@ -0,0 +1,109 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- G N A T . S E R I A L _ C O M M U N I C A T I O N S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2007, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- Serial communications package, implemented on Windows and GNU/Linux + +with Ada.Streams; +with Interfaces.C; + +package GNAT.Serial_Communications is + + Serial_Error : exception; + -- Raised when a communication problem occurs + + type Port_Name is new String; + -- A serial com port name + + function Name (Number : Positive) return Port_Name; + -- Returns the port name for the given port number + + type Data_Rate is (B1200, B2400, B4800, B9600, B19200, B38400, B57600); + -- Speed of the communication + + type Data_Bits is (B8, B7); + -- Communication bits + + type Serial_Port is new Ada.Streams.Root_Stream_Type with private; + + procedure Open + (Port : out Serial_Port; + Name : Port_Name); + -- Open the given port name. Raises Serial_Error if the port cannot be + -- opened. + + procedure Set + (Port : Serial_Port; + Rate : Data_Rate := B9600; + Bits : Data_Bits := B8; + Block : Boolean := True; + Timeout : Integer := 10); + -- The communication port settings. If Block is set then a read call + -- will wait for the whole buffer to be filed. If Block is not set then + -- the given Timeout (in seconds) is used. + + overriding procedure Read + (Port : in out Serial_Port; + Buffer : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + -- Read a set of bytes, put result into Buffer and set Last accordingly. + -- Last is set to 0 if no byte has been read. + + overriding procedure Write + (Port : in out Serial_Port; + Buffer : Ada.Streams.Stream_Element_Array); + -- Write buffer into the port + + procedure Close (Port : in out Serial_Port); + -- Close port + +private + + type Port_Data; + type Port_Data_Access is access Port_Data; + + type Serial_Port is new Ada.Streams.Root_Stream_Type with record + H : Port_Data_Access; + end record; + + Data_Rate_Value : constant array (Data_Rate) of Interfaces.C.unsigned := + (B1200 => 1_200, + B2400 => 2_400, + B4800 => 4_800, + B9600 => 9_600, + B19200 => 19_200, + B38400 => 38_400, + B57600 => 57_600); + + Bit_Value : constant array (Data_Bits) of Interfaces.C.unsigned := (8, 7); + +end GNAT.Serial_Communications; diff --git a/gcc/ada/g-soccon-aix.ads b/gcc/ada/g-soccon-aix.ads index f96cad40896..b1f6376082d 100644 --- a/gcc/ada/g-soccon-aix.ads +++ b/gcc/ada/g-soccon-aix.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-darwin.ads b/gcc/ada/g-soccon-darwin.ads index 7d82375763f..b48c4df65ed 100644 --- a/gcc/ada/g-soccon-darwin.ads +++ b/gcc/ada/g-soccon-darwin.ads @@ -35,7 +35,7 @@ -- by the GNAT.Sockets package (g-socket.ads). This package should not be -- directly with'ed by an applications program. --- This is the version for powerpc-apple-darwin8.8.0 +-- This is the version for powerpc-apple-darwin8.9.0 -- This file is generated automatically, do not modify it by hand! Instead, -- make changes to gen-soccon.c and re-run it on each target. @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -182,7 +183,7 @@ package GNAT.Sockets.Constants is -- Properties of supported interfaces -- ---------------------------------------- - Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops + Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops ---------------------- -- Additional flags -- diff --git a/gcc/ada/g-soccon-freebsd.ads b/gcc/ada/g-soccon-freebsd.ads index 045c8a095cf..c07fc1852d6 100644 --- a/gcc/ada/g-soccon-freebsd.ads +++ b/gcc/ada/g-soccon-freebsd.ads @@ -35,7 +35,7 @@ -- by the GNAT.Sockets package (g-socket.ads). This package should not be -- directly with'ed by an applications program. --- This is the version for i386-unknown-freebsd6.1 +-- This is the version for i386-unknown-freebsd6.2 -- This file is generated automatically, do not modify it by hand! Instead, -- make changes to gen-soccon.c and re-run it on each target. @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-hpux-ia64.ads b/gcc/ada/g-soccon-hpux-ia64.ads index 04cfc15a231..3caa99cc0ad 100644 --- a/gcc/ada/g-soccon-hpux-ia64.ads +++ b/gcc/ada/g-soccon-hpux-ia64.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-hpux.ads b/gcc/ada/g-soccon-hpux.ads index d2262176a52..9be66ad4f08 100644 --- a/gcc/ada/g-soccon-hpux.ads +++ b/gcc/ada/g-soccon-hpux.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-irix.ads b/gcc/ada/g-soccon-irix.ads index 7beb802a3ed..1f367548705 100644 --- a/gcc/ada/g-soccon-irix.ads +++ b/gcc/ada/g-soccon-irix.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 22; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 23; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 24; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-linux-64.ads b/gcc/ada/g-soccon-linux-64.ads index 5c2946b4b34..0cbafed9fe0 100644 --- a/gcc/ada/g-soccon-linux-64.ads +++ b/gcc/ada/g-soccon-linux-64.ads @@ -35,7 +35,7 @@ -- by the GNAT.Sockets package (g-socket.ads). This package should not be -- directly with'ed by an applications program. --- This is the version for ia64-hp-linux-gnu +-- This is the version for x86_64-pc-linux-gnu -- This file is generated automatically, do not modify it by hand! Instead, -- make changes to gen-soccon.c and re-run it on each target. @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 2; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs SO_LINGER : constant := 13; -- Defer close to flush data SO_BROADCAST : constant := 6; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group + IP_PKTINFO : constant := 8; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-linux-x86.ads b/gcc/ada/g-soccon-linux-x86.ads index cb42441a57c..ca1418f3fca 100644 --- a/gcc/ada/g-soccon-linux-x86.ads +++ b/gcc/ada/g-soccon-linux-x86.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 2; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs SO_LINGER : constant := 13; -- Defer close to flush data SO_BROADCAST : constant := 6; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group + IP_PKTINFO : constant := 8; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-lynxos.ads b/gcc/ada/g-soccon-lynxos.ads index 851bfbe7cc3..f93e88e53ff 100644 --- a/gcc/ada/g-soccon-lynxos.ads +++ b/gcc/ada/g-soccon-lynxos.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-mingw.ads b/gcc/ada/g-soccon-mingw.ads index 3e612a1a18c..dc39f810e2f 100644 --- a/gcc/ada/g-soccon-mingw.ads +++ b/gcc/ada/g-soccon-mingw.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := 19; -- Get datagram info ------------------- -- System limits -- @@ -184,13 +186,6 @@ package GNAT.Sockets.Constants is Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops - ---------------------- - -- Additional flags -- - ---------------------- - - Thread_Blocking_IO : constant Boolean := True; - -- Set False for contexts where socket i/o are process blocking - ------------------------------ -- MinGW-specific constants -- ------------------------------ @@ -203,4 +198,11 @@ package GNAT.Sockets.Constants is WSANOTINITIALISED : constant := 10093; -- Winsock not intialized WSAEDISCON : constant := 10101; -- Disconnected + ---------------------- + -- Additional flags -- + ---------------------- + + Thread_Blocking_IO : constant Boolean := True; + -- Set False for contexts where socket i/o are process blocking + end GNAT.Sockets.Constants; diff --git a/gcc/ada/g-soccon-solaris-64.ads b/gcc/ada/g-soccon-solaris-64.ads index 46300e061e1..5f57e176cb3 100644 --- a/gcc/ada/g-soccon-solaris-64.ads +++ b/gcc/ada/g-soccon-solaris-64.ads @@ -35,7 +35,7 @@ -- by the GNAT.Sockets package (g-socket.ads). This package should not be -- directly with'ed by an applications program. --- This is the version for sparc-sun-solaris2.8/64 +-- This is the version for sparc64-sun-solaris2.8 -- This file is generated automatically, do not modify it by hand! Instead, -- make changes to gen-soccon.c and re-run it on each target. @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-solaris.ads b/gcc/ada/g-soccon-solaris.ads index 26638a9b783..4b433bf5792 100644 --- a/gcc/ada/g-soccon-solaris.ads +++ b/gcc/ada/g-soccon-solaris.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-tru64.ads b/gcc/ada/g-soccon-tru64.ads index 5537151ac4f..8e16fbe7e39 100644 --- a/gcc/ada/g-soccon-tru64.ads +++ b/gcc/ada/g-soccon-tru64.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon-vms.ads b/gcc/ada/g-soccon-vms.ads index a8aff61fc74..44b8523a36a 100644 --- a/gcc/ada/g-soccon-vms.ads +++ b/gcc/ada/g-soccon-vms.ads @@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address + SO_REUSEPORT : constant := 512; -- Bind reuse port number SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs @@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group + IP_PKTINFO : constant := -1; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-soccon.ads b/gcc/ada/g-soccon.ads index 6890c65fc2d..b57711d976e 100644 --- a/gcc/ada/g-soccon.ads +++ b/gcc/ada/g-soccon.ads @@ -156,6 +156,7 @@ package GNAT.Sockets.Constants is TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 2; -- Bind reuse local address + SO_REUSEPORT : constant := -1; -- Bind reuse port number SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs SO_LINGER : constant := 13; -- Defer close to flush data SO_BROADCAST : constant := 6; -- Can send broadcast msgs @@ -169,6 +170,7 @@ package GNAT.Sockets.Constants is IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group + IP_PKTINFO : constant := 8; -- Get datagram info ------------------- -- System limits -- diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 04cfdd74d01..e491eed89ac 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2007, AdaCore -- +-- Copyright (C) 2001-2008, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -87,21 +87,24 @@ package body GNAT.Sockets is N_Bytes_To_Read => Constants.FIONREAD); Options : constant array (Option_Name) of C.int := - (Keep_Alive => Constants.SO_KEEPALIVE, - Reuse_Address => Constants.SO_REUSEADDR, - Broadcast => Constants.SO_BROADCAST, - Send_Buffer => Constants.SO_SNDBUF, - Receive_Buffer => Constants.SO_RCVBUF, - Linger => Constants.SO_LINGER, - Error => Constants.SO_ERROR, - No_Delay => Constants.TCP_NODELAY, - Add_Membership => Constants.IP_ADD_MEMBERSHIP, - Drop_Membership => Constants.IP_DROP_MEMBERSHIP, - Multicast_If => Constants.IP_MULTICAST_IF, - Multicast_TTL => Constants.IP_MULTICAST_TTL, - Multicast_Loop => Constants.IP_MULTICAST_LOOP, - Send_Timeout => Constants.SO_SNDTIMEO, - Receive_Timeout => Constants.SO_RCVTIMEO); + (Keep_Alive => Constants.SO_KEEPALIVE, + Reuse_Address => Constants.SO_REUSEADDR, + Broadcast => Constants.SO_BROADCAST, + Send_Buffer => Constants.SO_SNDBUF, + Receive_Buffer => Constants.SO_RCVBUF, + Linger => Constants.SO_LINGER, + Error => Constants.SO_ERROR, + No_Delay => Constants.TCP_NODELAY, + Add_Membership => Constants.IP_ADD_MEMBERSHIP, + Drop_Membership => Constants.IP_DROP_MEMBERSHIP, + Multicast_If => Constants.IP_MULTICAST_IF, + Multicast_TTL => Constants.IP_MULTICAST_TTL, + Multicast_Loop => Constants.IP_MULTICAST_LOOP, + Receive_Packet_Info => Constants.IP_PKTINFO, + Send_Timeout => Constants.SO_SNDTIMEO, + Receive_Timeout => Constants.SO_RCVTIMEO); + -- ??? Note: for OpenSolaris, Receive_Packet_Info should be IP_RECVPKTINFO, + -- but for Linux compatibility this constant is the same as IP_PKTINFO. Flags : constant array (0 .. 3) of C.int := (0 => Constants.MSG_OOB, -- Process_Out_Of_Band_Data @@ -865,8 +868,7 @@ package body GNAT.Sockets is begin if Safe_Getservbyname (SN, SP, Res'Access, Buf'Address, Buflen) /= 0 then - Ada.Exceptions.Raise_Exception - (Service_Error'Identity, "Service not found"); + raise Service_Error with "Service not found"; end if; -- Translate from the C format to the API format @@ -892,8 +894,7 @@ package body GNAT.Sockets is (C.int (Short_To_Network (C.unsigned_short (Port))), SP, Res'Access, Buf'Address, Buflen) /= 0 then - Ada.Exceptions.Raise_Exception - (Service_Error'Identity, "Service not found"); + raise Service_Error with "Service not found"; end if; -- Translate from the C format to the API format @@ -946,8 +947,9 @@ package body GNAT.Sockets is begin case Name is - when Multicast_Loop | - Multicast_TTL => + when Multicast_Loop | + Multicast_TTL | + Receive_Packet_Info => Len := V1'Size / 8; Add := V1'Address; @@ -1015,7 +1017,8 @@ package body GNAT.Sockets is when Multicast_TTL => Opt.Time_To_Live := Integer (V1); - when Multicast_Loop => + when Multicast_Loop | + Receive_Packet_Info => Opt.Enabled := (V1 /= 0); when Send_Timeout | @@ -1320,9 +1323,9 @@ package body GNAT.Sockets is procedure Raise_Host_Error (H_Error : Integer) is begin - Ada.Exceptions.Raise_Exception (Host_Error'Identity, + raise Host_Error with Err_Code_Image (H_Error) - & C.Strings.Value (Host_Error_Messages.Host_Error_Message (H_Error))); + & C.Strings.Value (Host_Error_Messages.Host_Error_Message (H_Error)); end Raise_Host_Error; ------------------------ @@ -1332,9 +1335,9 @@ package body GNAT.Sockets is procedure Raise_Socket_Error (Error : Integer) is use type C.Strings.chars_ptr; begin - Ada.Exceptions.Raise_Exception (Socket_Error'Identity, + raise Socket_Error with Err_Code_Image (Error) - & C.Strings.Value (Socket_Error_Message (Error))); + & C.Strings.Value (Socket_Error_Message (Error)); end Raise_Socket_Error; ---------- @@ -1795,7 +1798,8 @@ package body GNAT.Sockets is Len := V1'Size / 8; Add := V1'Address; - when Multicast_Loop => + when Multicast_Loop | + Receive_Packet_Info => V1 := C.unsigned_char (Boolean'Pos (Option.Enabled)); Len := V1'Size / 8; Add := V1'Address; diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads index cbbb1331af0..105f285a8b4 100644 --- a/gcc/ada/g-socket.ads +++ b/gcc/ada/g-socket.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2007, AdaCore -- +-- Copyright (C) 2001-2008, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -623,30 +623,32 @@ package GNAT.Sockets is -- a boolean to enable or disable this option. type Option_Name is ( - Keep_Alive, -- Enable sending of keep-alive messages - Reuse_Address, -- Allow bind to reuse local address - Broadcast, -- Enable datagram sockets to recv/send broadcasts - Send_Buffer, -- Set/get the maximum socket send buffer in bytes - Receive_Buffer, -- Set/get the maximum socket recv buffer in bytes - Linger, -- Shutdown wait for msg to be sent or timeout occur - Error, -- Get and clear the pending socket error - No_Delay, -- Do not delay send to coalesce packets (TCP_NODELAY) - Add_Membership, -- Join a multicast group - Drop_Membership, -- Leave a multicast group - Multicast_If, -- Set default outgoing interface for multicast packets - Multicast_TTL, -- Indicate the time-to-live of sent multicast packets - Multicast_Loop, -- Sent multicast packets are looped to local socket - Send_Timeout, -- Set timeout value for output - Receive_Timeout); -- Set timeout value for input + Keep_Alive, -- Enable sending of keep-alive messages + Reuse_Address, -- Allow bind to reuse local address + Broadcast, -- Enable datagram sockets to recv/send broadcasts + Send_Buffer, -- Set/get the maximum socket send buffer in bytes + Receive_Buffer, -- Set/get the maximum socket recv buffer in bytes + Linger, -- Shutdown wait for msg to be sent or timeout occur + Error, -- Get and clear the pending socket error + No_Delay, -- Do not delay send to coalesce data (TCP_NODELAY) + Add_Membership, -- Join a multicast group + Drop_Membership, -- Leave a multicast group + Multicast_If, -- Set default out interface for multicast packets + Multicast_TTL, -- Set the time-to-live of sent multicast packets + Multicast_Loop, -- Sent multicast packets are looped to local socket + Receive_Packet_Info, -- Receive low level packet info as ancillary data + Send_Timeout, -- Set timeout value for output + Receive_Timeout); -- Set timeout value for input type Option_Type (Name : Option_Name := Keep_Alive) is record case Name is - when Keep_Alive | - Reuse_Address | - Broadcast | - Linger | - No_Delay | - Multicast_Loop => + when Keep_Alive | + Reuse_Address | + Broadcast | + Linger | + No_Delay | + Receive_Packet_Info | + Multicast_Loop => Enabled : Boolean; case Name is diff --git a/gcc/ada/g-spipat.adb b/gcc/ada/g-spipat.adb index 0e56f8ac409..1e0c85c22c4 100644 --- a/gcc/ada/g-spipat.adb +++ b/gcc/ada/g-spipat.adb @@ -36,7 +36,6 @@ -- a direct translation, but the approach is followed closely. In particular, -- we use the one stack approach developed in the SPITBOL implementation. -with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings.Unbounded.Aux; use Ada.Strings.Unbounded.Aux; with GNAT.Debug_Utilities; use GNAT.Debug_Utilities; @@ -2782,9 +2781,8 @@ package body GNAT.Spitbol.Patterns is procedure Logic_Error is begin - Raise_Exception - (Program_Error'Identity, - "Internal logic error in GNAT.Spitbol.Patterns"); + raise Program_Error with + "Internal logic error in GNAT.Spitbol.Patterns"; end Logic_Error; ----------- @@ -3644,9 +3642,8 @@ package body GNAT.Spitbol.Patterns is procedure Uninitialized_Pattern is begin - Raise_Exception - (Program_Error'Identity, - "uninitialized value of type GNAT.Spitbol.Patterns.Pattern"); + raise Program_Error with + "uninitialized value of type GNAT.Spitbol.Patterns.Pattern"; end Uninitialized_Pattern; ------------ diff --git a/gcc/ada/g-spipat.ads b/gcc/ada/g-spipat.ads index fd1281c8ce7..af4aed19f57 100644 --- a/gcc/ada/g-spipat.ads +++ b/gcc/ada/g-spipat.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1997-2006, AdaCore -- +-- Copyright (C) 1997-2007, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -693,6 +693,12 @@ package GNAT.Spitbol.Patterns is -- body, manage to interprete them properly as though they were indeed -- in out parameters. + pragma Warnings (Off, VString_Var); + pragma Warnings (Off, Pattern_Var); + -- We turn off warnings for these two types so that when variables are used + -- as arguments in this context, warnings about them not being assigned in + -- the source program will be suppressed. + -------------------------------- -- Basic Pattern Construction -- -------------------------------- diff --git a/gcc/ada/g-trasym.ads b/gcc/ada/g-trasym.ads index 346f73bdac9..8b358aac4bc 100644 --- a/gcc/ada/g-trasym.ads +++ b/gcc/ada/g-trasym.ads @@ -84,10 +84,6 @@ with Ada.Exceptions; use Ada.Exceptions; package GNAT.Traceback.Symbolic is pragma Elaborate_Body; - ------------------------ - -- Symbolic_Traceback -- - ------------------------ - function Symbolic_Traceback (Traceback : Tracebacks_Array) return String; -- Build a string containing a symbolic traceback of the given call chain diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 84564acb24e..e85bff7d712 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -170,6 +170,7 @@ Implementation Defined Pragmas * Pragma No_Strict_Aliasing :: * Pragma Normalize_Scalars:: * Pragma Obsolescent:: +* Pragma Optimize_Alignment:: * Pragma Passive:: * Pragma Persistent_BSS:: * Pragma Polling:: @@ -198,6 +199,7 @@ Implementation Defined Pragmas * Pragma Unimplemented_Unit:: * Pragma Universal_Aliasing :: * Pragma Universal_Data:: +* Pragma Unmodified:: * Pragma Unreferenced:: * Pragma Unreferenced_Objects:: * Pragma Unreserve_All_Interrupts:: @@ -241,6 +243,7 @@ Implementation Defined Attributes * Mechanism_Code:: * Null_Parameter:: * Object_Size:: +* Old:: * Passed_By_Reference:: * Pool_Address:: * Range_Length:: @@ -283,12 +286,14 @@ The GNAT Library * Ada.Characters.Latin_9 (a-chlat9.ads):: * Ada.Characters.Wide_Latin_1 (a-cwila1.ads):: * Ada.Characters.Wide_Latin_9 (a-cwila9.ads):: -* Ada.Characters.Wide_Wide_Latin_1 (a-czila1.ads):: -* Ada.Characters.Wide_Wide_Latin_9 (a-czila9.ads):: -* Ada.Command_Line.Remove (a-colire.ads):: +* Ada.Characters.Wide_Wide_Latin_1 (a-chzla1.ads):: +* Ada.Characters.Wide_Wide_Latin_9 (a-chzla9.ads):: * Ada.Command_Line.Environment (a-colien.ads):: +* Ada.Command_Line.Remove (a-colire.ads):: +* Ada.Command_Line.Response_File (a-clrefi.ads):: * Ada.Direct_IO.C_Streams (a-diocst.ads):: * Ada.Exceptions.Is_Null_Occurrence (a-einuoc.ads):: +* Ada.Exceptions.Last_Chance_Handler (a-elchha.ads):: * Ada.Exceptions.Traceback (a-exctra.ads):: * Ada.Sequential_IO.C_Streams (a-siocst.ads):: * Ada.Streams.Stream_IO.C_Streams (a-ssicst.ads):: @@ -296,7 +301,9 @@ The GNAT Library * Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads):: * Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads):: * Ada.Text_IO.C_Streams (a-tiocst.ads):: +* Ada.Wide_Characters.Unicode (a-wichun.ads):: * Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads):: +* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads):: * Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads):: * GNAT.Altivec (g-altive.ads):: * GNAT.Altivec.Conversions (g-altcon.ads):: @@ -350,12 +357,13 @@ The GNAT Library * GNAT.Most_Recent_Exception (g-moreex.ads):: * GNAT.OS_Lib (g-os_lib.ads):: * GNAT.Perfect_Hash_Generators (g-pehage.ads):: -* GNAT.Random_Numbers (g-rannum.ads) +* GNAT.Random_Numbers (g-rannum.ads):: * GNAT.Regexp (g-regexp.ads):: * GNAT.Registry (g-regist.ads):: * GNAT.Regpat (g-regpat.ads):: * GNAT.Secondary_Stack_Info (g-sestin.ads):: * GNAT.Semaphores (g-semaph.ads):: +* GNAT.Serial_Communications (g-sercom.ads):: * GNAT.SHA1 (g-sha1.ads):: * GNAT.Signals (g-signal.ads):: * GNAT.Sockets (g-socket.ads):: @@ -383,10 +391,6 @@ The GNAT Library * Interfaces.C.Extensions (i-cexten.ads):: * Interfaces.C.Streams (i-cstrea.ads):: * Interfaces.CPP (i-cpp.ads):: -* Interfaces.Os2lib (i-os2lib.ads):: -* Interfaces.Os2lib.Errors (i-os2err.ads):: -* Interfaces.Os2lib.Synchronization (i-os2syn.ads):: -* Interfaces.Os2lib.Threads (i-os2thr.ads):: * Interfaces.Packed_Decimal (i-pacdec.ads):: * Interfaces.VxWorks (i-vxwork.ads):: * Interfaces.VxWorks.IO (i-vxwoio.ads):: @@ -394,6 +398,8 @@ The GNAT Library * System.Assertions (s-assert.ads):: * System.Memory (s-memory.ads):: * System.Partition_Interface (s-parint.ads):: +* System.Pool_Global (s-pooglo.ads):: +* System.Pool_Local (s-pooloc.ads):: * System.Restrictions (s-restri.ads):: * System.Rident (s-rident.ads):: * System.Task_Info (s-tasinf.ads):: @@ -758,6 +764,7 @@ consideration, the use of these pragmas should be minimized. * Pragma No_Strict_Aliasing:: * Pragma Normalize_Scalars:: * Pragma Obsolescent:: +* Pragma Optimize_Alignment:: * Pragma Passive:: * Pragma Persistent_BSS:: * Pragma Polling:: @@ -786,6 +793,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Unimplemented_Unit:: * Pragma Universal_Aliasing :: * Pragma Universal_Data:: +* Pragma Unmodified:: * Pragma Unreferenced:: * Pragma Unreferenced_Objects:: * Pragma Unreserve_All_Interrupts:: @@ -1162,7 +1170,15 @@ pragma Compile_Time_Warning @noindent Same as pragma Compile_Time_Error, except a warning is issued instead -of an error message. +of an error message. Note that if this pragma is used in a package that +is with'ed by a client, the client will get the warning even though it +is issued by a with'ed package (normally warnings in with'ed units are +suppressed, but this is a special exception to that rule). + +One typical use is within a generic where compile time known characteristics +of formal parameters are tested, and warnings given appropriately. Another use +with a first parameter of True is to warn a client about use of a package, +for example that it is not fully implemented. @node Pragma Complete_Representation @unnumberedsec Pragma Complete_Representation @@ -3373,6 +3389,77 @@ Entity parameter is omitted, then the pragma applies to the declaration immediately preceding the pragma (this form cannot be used for the enumeration literal case). +@node Pragma Optimize_Alignment +@unnumberedsec Pragma Optimize_Alignment +@findex Optimize_Alignment +@cindex Alignment, default settings +@noindent +Syntax: + +@smallexample @c ada +pragma Optimize_Alignment (TIME | SPACE | OFF); +@end smallexample + +@noindent +This is a configuration pragma which affects the choice of default alignments +for types where no alignment is explicitly specified. There is a time/space +trade-off in the selection of these values. Large alignments result in more +efficient code, at the expense of larger data space, since sizes have to be +increased to match these alignments. Smaller alignments save space, but the +access code is slower. The normal choice of default alignments (which is what +you get if you do not use this pragma, or if you use an argument of OFF), +tries to balance these two requirements. + +Specifying SPACE causes smaller default alignments to be chosen in two cases. +First any packed record is given an alignment of 1. Second, if a size is given +for the type, then the alignment is chosen to avoid increasing this size. For +example, consider: + +@smallexample @c ada + type R is record + X : Integer; + Y : Character; + end record; + + for R'Size use 5*8; +@end smallexample + +@noindent +In the default mode, this type gets an alignment of 4, so that access to the +Integer field X are efficient. But this means that objects of the type end up +with a size of 8 bytes. This is a valid choice, since sizes of objects are +allowed to be bigger than the size of the type, but it can waste space if for +example fields of type R appear in an enclosing record. If the above type is +compiled in @code{Optimize_Alignment (Space)} mode, the alignment is set to 1. + +Specifying TIME causes larger default alignments to be chosen in the case of +small types with sizes that are not a power of 2. For example, consider: + +@smallexample @c ada + type R is record + A : Character; + B : Character; + C : Boolean; + end record; + + pragma Pack (R); + for R'Size use 17; +@end smallexample + +@noindent +The default alignment for this record is normally 1, but if this type is +compiled in @code{Optimize_Alignment (Time)} mode, then the alignment is set +to 4, which wastes space for objects of the type, since they are now 4 bytes +long, but results in more efficient access when the whole record is referenced. + +As noted above, this is a configuration pragma, and there is a requirement +that all units in a partition be compiled with a consistent setting of the +optimization setting. This would normally be achieved by use of a configuration +pragma file containing the appropriate setting. The exception to this rule is +that predefined units in the GNAT library (that is, members of the Ada, System, +Interfaces, GNAT hierarchies) ignore the setting of this pragma, and thus the +consistency requirement does not apply to them. + @node Pragma Passive @unnumberedsec Pragma Passive @findex Passive @@ -4313,6 +4400,31 @@ a library unit pragma, but can also be used as a configuration pragma of this pragma is also available by applying the -univ switch on the compilations of units where universal addressing of the data is desired. +@node Pragma Unmodified +@unnumberedsec Pragma Unmodified +@findex Unmodified +@cindex Warnings, unmodified +@noindent +Syntax: + +@smallexample @c ada +pragma Unmodified (LOCAL_NAME @{, LOCAL_NAME@}); +@end smallexample + +@noindent +This pragma signals that the assignable entities (variables, +@code{out} parameters, @code{in out} parameters) whose names are listed are +deliberately not assigned in the current source unit. This +suppresses warnings about the +entities being referenced but not assigned, and in addition a warning will be +generated if one of these entities is in fact assigned in the +same unit as the pragma (or in the corresponding body, or one +of its subunits). + +This is particularly useful for clearly signaling that a particular +parameter is not modified, even though the spec suggests that it might +be. + @node Pragma Unreferenced @unnumberedsec Pragma Unreferenced @findex Unreferenced @@ -4578,55 +4690,66 @@ full details see @ref{Warning Message Control,,, gnat_ugn, @value{EDITION} User's Guide}. @smallexample -a turn on all optional warnings (except d,h,l) -A turn off all optional warnings -b turn on warnings for bad fixed value (not multiple of small) -B turn off warnings for bad fixed value (not multiple of small) -c turn on warnings for constant conditional -C turn off warnings for constant conditional -d turn on warnings for implicit dereference -D turn off warnings for implicit dereference -e treat all warnings as errors -f turn on warnings for unreferenced formal -F turn off warnings for unreferenced formal -g turn on warnings for unrecognized pragma -G turn off warnings for unrecognized pragma -h turn on warnings for hiding variable -H turn off warnings for hiding variable -i turn on warnings for implementation unit -I turn off warnings for implementation unit -j turn on warnings for obsolescent (annex J) feature -J turn off warnings for obsolescent (annex J) feature -k turn on warnings on constant variable -K turn off warnings on constant variable -l turn on warnings for missing elaboration pragma -L turn off warnings for missing elaboration pragma -m turn on warnings for variable assigned but not read -M turn off warnings for variable assigned but not read -n normal warning mode (cancels -gnatws/-gnatwe) -o turn on warnings for address clause overlay -O turn off warnings for address clause overlay -p turn on warnings for ineffective pragma Inline -P turn off warnings for ineffective pragma Inline -q turn on warnings for questionable missing parentheses -Q turn off warnings for questionable missing parentheses -r turn on warnings for redundant construct -R turn off warnings for redundant construct -s suppress all warnings -t turn on warnings for tracking deleted code -T turn off warnings for tracking deleted code -u turn on warnings for unused entity -U turn off warnings for unused entity -v turn on warnings for unassigned variable -V turn off warnings for unassigned variable -w turn on warnings for wrong low bound assumption -W turn off warnings for wrong low bound assumption -x turn on warnings for export/import -X turn off warnings for export/import -y turn on warnings for Ada 2005 incompatibility -Y turn off warnings for Ada 2005 incompatibility -z turn on size/align warnings for unchecked conversion -Z turn off size/align warnings for unchecked conversion +a turn on all optional warnings (except d h l .o) +A turn off all optional warnings +.a* turn on warnings for failing assertions +.A turn off warnings for failing assertions +b turn on warnings for bad fixed value (not multiple of small) +B* turn off warnings for bad fixed value (not multiple of small) +c turn on warnings for constant conditional +C* turn off warnings for constant conditional +.c turn on warnings for unrepped components +.C* turn off warnings for unrepped components +d turn on warnings for implicit dereference +D* turn off warnings for implicit dereference +e treat all warnings as errors +f turn on warnings for unreferenced formal +F* turn off warnings for unreferenced formal +g* turn on warnings for unrecognized pragma +G turn off warnings for unrecognized pragma +h turn on warnings for hiding variable +H* turn off warnings for hiding variable +i* turn on warnings for implementation unit +I turn off warnings for implementation unit +j turn on warnings for obsolescent (annex J) feature +J* turn off warnings for obsolescent (annex J) feature +k turn on warnings on constant variable +K* turn off warnings on constant variable +l turn on warnings for missing elaboration pragma +L* turn off warnings for missing elaboration pragma +m turn on warnings for variable assigned but not read +M* turn off warnings for variable assigned but not read +n* normal warning mode (cancels -gnatws/-gnatwe) +o* turn on warnings for address clause overlay +O turn off warnings for address clause overlay +.o turn on warnings for out parameters assigned but not read +.O* turn off warnings for out parameters assigned but not read +p turn on warnings for ineffective pragma Inline in frontend +P* turn off warnings for ineffective pragma Inline in frontend +q* turn on warnings for questionable missing parentheses +Q turn off warnings for questionable missing parentheses +r turn on warnings for redundant construct +R* turn off warnings for redundant construct +.r turn on warnings for object renaming function +.R* turn off warnings for object renaming function +s suppress all warnings +t turn on warnings for tracking deleted code +T* turn off warnings for tracking deleted code +u turn on warnings for unused entity +U* turn off warnings for unused entity +v* turn on warnings for unassigned variable +V turn off warnings for unassigned variable +w* turn on warnings for wrong low bound assumption +W turn off warnings for wrong low bound assumption +x* turn on warnings for export/import +X turn off warnings for export/import +.x turn on warnings for non-local exceptions +.X* turn off warnings for non-local exceptions +y* turn on warnings for Ada 2005 incompatibility +Y turn off warnings for Ada 2005 incompatibility +z* turn on convention/size/align warnings for unchecked conversion +Z turn off convention/size/align warnings for unchecked conversion +* indicates default in above list @end smallexample @noindent @@ -4796,6 +4919,7 @@ consideration, you should minimize the use of these attributes. * Mechanism_Code:: * Null_Parameter:: * Object_Size:: +* Old:: * Passed_By_Reference:: * Pool_Address:: * Range_Length:: @@ -5324,39 +5448,45 @@ alignment will be 4, because of the integer field, and so the default size of record objects for this type will be 64 (8 bytes). -The @code{@var{type}'Object_Size} attribute -has been added to GNAT to allow the -default object size of a type to be easily determined. For example, -@code{Natural'Object_Size} is 32, and -@code{Rec'Object_Size} (for the record type in the above example) will be -64. Note also that, unlike the situation with the -@code{Size} attribute as defined in the Ada RM, the -@code{Object_Size} attribute can be specified individually -for different subtypes. For example: +@node Old +@unnumberedsec Old +@cindex Capturing Old values +@cindex Postconditions +@noindent +The attribute Prefix'Old can be used within a +subprogram to refer to the value of the prefix on entry. So for +example if you have an argument of a record type X called Arg1, +you can refer to Arg1.Field'Old which yields the value of +Arg1.Field on entry. The implementation simply involves generating +an object declaration which captures the value on entry. Any +prefix is allowed except one of a limited type (since limited +types cannot be copied to capture their values). + +The following example shows the use of 'Old to implement +a test of a postcondition: @smallexample @c ada -type R is new Integer; -subtype R1 is R range 1 .. 10; -subtype R2 is R range 1 .. 10; -for R2'Object_Size use 8; -@end smallexample +with Old_Pkg; +procedure Old is +begin + Old_Pkg.Incr; +end Old; -@noindent -In this example, @code{R'Object_Size} and @code{R1'Object_Size} are both -32 since the default object size for a subtype is the same as the object size -for the parent subtype. This means that objects of type @code{R} -or @code{R1} will -by default be 32 bits (four bytes). But objects of type -@code{R2} will be only -8 bits (one byte), since @code{R2'Object_Size} has been set to 8. +package Old_Pkg is + procedure Incr; +end Old_Pkg; + +package body Old_Pkg is + Count : Natural := 0; + + procedure Incr is + begin + ... code manipulating the value of Count -Although @code{Object_Size} does properly reflect the default object size -value, it is not necessarily the case that all objects will be of this size -in a case where it is not specified explicitly. The compiler is free to -increase the size and alignment of stand alone objects to improve efficiency -of the generated code and sometimes does so in the case of large composite -objects. If the size of a stand alone object is critical to the -application, it should be specified explicitly. + pragma Assert (Count = Count'Old + 1); + end Incr; +end Old_Pkg; +@end smallexample @node Passed_By_Reference @unnumberedsec Passed_By_Reference @@ -12749,12 +12879,14 @@ of GNAT, and will generate a warning message. * Ada.Characters.Latin_9 (a-chlat9.ads):: * Ada.Characters.Wide_Latin_1 (a-cwila1.ads):: * Ada.Characters.Wide_Latin_9 (a-cwila9.ads):: -* Ada.Characters.Wide_Wide_Latin_1 (a-czila1.ads):: -* Ada.Characters.Wide_Wide_Latin_9 (a-czila9.ads):: -* Ada.Command_Line.Remove (a-colire.ads):: +* Ada.Characters.Wide_Wide_Latin_1 (a-chzla1.ads):: +* Ada.Characters.Wide_Wide_Latin_9 (a-chzla9.ads):: * Ada.Command_Line.Environment (a-colien.ads):: +* Ada.Command_Line.Remove (a-colire.ads):: +* Ada.Command_Line.Response_File (a-clrefi.ads):: * Ada.Direct_IO.C_Streams (a-diocst.ads):: * Ada.Exceptions.Is_Null_Occurrence (a-einuoc.ads):: +* Ada.Exceptions.Last_Chance_Handler (a-elchha.ads):: * Ada.Exceptions.Traceback (a-exctra.ads):: * Ada.Sequential_IO.C_Streams (a-siocst.ads):: * Ada.Streams.Stream_IO.C_Streams (a-ssicst.ads):: @@ -12762,7 +12894,9 @@ of GNAT, and will generate a warning message. * Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads):: * Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads):: * Ada.Text_IO.C_Streams (a-tiocst.ads):: +* Ada.Wide_Characters.Unicode (a-wichun.ads):: * Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads):: +* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads):: * Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads):: * GNAT.Altivec (g-altive.ads):: * GNAT.Altivec.Conversions (g-altcon.ads):: @@ -12780,7 +12914,6 @@ of GNAT, and will generate a warning message. * GNAT.Byte_Swapping (g-bytswa.ads):: * GNAT.Calendar (g-calend.ads):: * GNAT.Calendar.Time_IO (g-catiio.ads):: -* GNAT.CRC32 (g-crc32.ads):: * GNAT.Case_Util (g-casuti.ads):: * GNAT.CGI (g-cgi.ads):: * GNAT.CGI.Cookie (g-cgicoo.ads):: @@ -12788,6 +12921,7 @@ of GNAT, and will generate a warning message. * GNAT.Command_Line (g-comlin.ads):: * GNAT.Compiler_Version (g-comver.ads):: * GNAT.Ctrl_C (g-ctrl_c.ads):: +* GNAT.CRC32 (g-crc32.ads):: * GNAT.Current_Exception (g-curexc.ads):: * GNAT.Debug_Pools (g-debpoo.ads):: * GNAT.Debug_Utilities (g-debuti.ads):: @@ -12822,6 +12956,7 @@ of GNAT, and will generate a warning message. * GNAT.Regpat (g-regpat.ads):: * GNAT.Secondary_Stack_Info (g-sestin.ads):: * GNAT.Semaphores (g-semaph.ads):: +* GNAT.Serial_Communications (g-sercom.ads):: * GNAT.SHA1 (g-sha1.ads):: * GNAT.Signals (g-signal.ads):: * GNAT.Sockets (g-socket.ads):: @@ -12849,10 +12984,6 @@ of GNAT, and will generate a warning message. * Interfaces.C.Extensions (i-cexten.ads):: * Interfaces.C.Streams (i-cstrea.ads):: * Interfaces.CPP (i-cpp.ads):: -* Interfaces.Os2lib (i-os2lib.ads):: -* Interfaces.Os2lib.Errors (i-os2err.ads):: -* Interfaces.Os2lib.Synchronization (i-os2syn.ads):: -* Interfaces.Os2lib.Threads (i-os2thr.ads):: * Interfaces.Packed_Decimal (i-pacdec.ads):: * Interfaces.VxWorks (i-vxwork.ads):: * Interfaces.VxWorks.IO (i-vxwoio.ads):: @@ -12860,6 +12991,8 @@ of GNAT, and will generate a warning message. * System.Assertions (s-assert.ads):: * System.Memory (s-memory.ads):: * System.Partition_Interface (s-parint.ads):: +* System.Pool_Global (s-pooglo.ads):: +* System.Pool_Local (s-pooloc.ads):: * System.Restrictions (s-restri.ads):: * System.Rident (s-rident.ads):: * System.Task_Info (s-tasinf.ads):: @@ -12909,9 +13042,9 @@ instead of @code{Character}. The provision of such a package is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). -@node Ada.Characters.Wide_Wide_Latin_1 (a-czila1.ads) -@section @code{Ada.Characters.Wide_Wide_Latin_1} (@file{a-czila1.ads}) -@cindex @code{Ada.Characters.Wide_Wide_Latin_1} (@file{a-czila1.ads}) +@node Ada.Characters.Wide_Wide_Latin_1 (a-chzla1.ads) +@section @code{Ada.Characters.Wide_Wide_Latin_1} (@file{a-chzla1.ads}) +@cindex @code{Ada.Characters.Wide_Wide_Latin_1} (@file{a-chzla1.ads}) @cindex Latin_1 constants for Wide_Wide_Character @noindent @@ -12923,9 +13056,9 @@ instead of @code{Character}. The provision of such a package is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). -@node Ada.Characters.Wide_Wide_Latin_9 (a-czila9.ads) -@section @code{Ada.Characters.Wide_Wide_Latin_9} (@file{a-czila9.ads}) -@cindex @code{Ada.Characters.Wide_Wide_Latin_9} (@file{a-czila9.ads}) +@node Ada.Characters.Wide_Wide_Latin_9 (a-chzla9.ads) +@section @code{Ada.Characters.Wide_Wide_Latin_9} (@file{a-chzla9.ads}) +@cindex @code{Ada.Characters.Wide_Wide_Latin_9} (@file{a-chzla9.ads}) @cindex Latin_9 constants for Wide_Wide_Character @noindent @@ -12937,6 +13070,16 @@ instead of @code{Character}. The provision of such a package is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). +@node Ada.Command_Line.Environment (a-colien.ads) +@section @code{Ada.Command_Line.Environment} (@file{a-colien.ads}) +@cindex @code{Ada.Command_Line.Environment} (@file{a-colien.ads}) +@cindex Environment entries + +@noindent +This child of @code{Ada.Command_Line} +provides a mechanism for obtaining environment values on systems +where this concept makes sense. + @node Ada.Command_Line.Remove (a-colire.ads) @section @code{Ada.Command_Line.Remove} (@file{a-colire.ads}) @cindex @code{Ada.Command_Line.Remove} (@file{a-colire.ads}) @@ -12950,15 +13093,18 @@ arguments from the argument list. Once removed, an argument is not visible to further calls on the subprograms in @code{Ada.Command_Line} will not see the removed argument. -@node Ada.Command_Line.Environment (a-colien.ads) -@section @code{Ada.Command_Line.Environment} (@file{a-colien.ads}) -@cindex @code{Ada.Command_Line.Environment} (@file{a-colien.ads}) -@cindex Environment entries +@node Ada.Command_Line.Response_File (a-clrefi.ads) +@section @code{Ada.Command_Line.Response_File} (@file{a-clrefi.ads}) +@cindex @code{Ada.Command_Line.Response_File} (@file{a-clrefi.ads}) +@cindex Response file for command line +@cindex Command line, response file +@cindex Command line, handling long command lines @noindent -This child of @code{Ada.Command_Line} -provides a mechanism for obtaining environment values on systems -where this concept makes sense. +This child of @code{Ada.Command_Line} provides a mechanism facilities for +getting command line arguments from a text file, called a "response file". +Using a response file allow passing a set of arguments to an executable longer +than the maximum allowed by the system on the command line. @node Ada.Direct_IO.C_Streams (a-diocst.ads) @section @code{Ada.Direct_IO.C_Streams} (@file{a-diocst.ads}) @@ -12981,6 +13127,16 @@ This child subprogram provides a way of testing for the null exception occurrence (@code{Null_Occurrence}) without raising an exception. +@node Ada.Exceptions.Last_Chance_Handler (a-elchha.ads) +@section @code{Ada.Exceptions.Last_Chance_Handler} (@file{a-elchha.ads}) +@cindex @code{Ada.Exceptions.Last_Chance_Handler} (@file{a-elchha.ads}) +@cindex Null_Occurrence, testing for + +@noindent +This child subprogram is used for handling otherwise unhandled +exceptions (hence the name last chance), and perform clean ups before +terminating the program. Note that this subprogram never returns. + @node Ada.Exceptions.Traceback (a-exctra.ads) @section @code{Ada.Exceptions.Traceback} (@file{a-exctra.ads}) @cindex @code{Ada.Exceptions.Traceback} (@file{a-exctra.ads}) @@ -13057,6 +13213,15 @@ C streams and @code{Text_IO}. The stream identifier can be extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. +@node Ada.Wide_Characters.Unicode (a-wichun.ads) +@section @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads}) +@cindex @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads}) +@cindex Unicode categorization, Wide_Character + +@noindent +This package provides subprograms that allow categorization of +Wide_Character values according to Unicode categories. + @node Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads) @section @code{Ada.Wide_Text_IO.C_Streams} (@file{a-wtcstr.ads}) @cindex @code{Ada.Wide_Text_IO.C_Streams} (@file{a-wtcstr.ads}) @@ -13068,6 +13233,15 @@ C streams and @code{Wide_Text_IO}. The stream identifier can be extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. +@node Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads) +@section @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads}) +@cindex @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads}) +@cindex Unicode categorization, Wide_Wide_Character + +@noindent +This package provides subprograms that allow categorization of +Wide_Wide_Character values according to Unicode categories. + @node Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads) @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@file{a-ztcstr.ads}) @cindex @code{Ada.Wide_Wide_Text_IO.C_Streams} (@file{a-ztcstr.ads}) @@ -13726,6 +13900,15 @@ secondary stack. @noindent Provides classic counting and binary semaphores using protected types. +@node GNAT.Serial_Communications (g-sercom.ads) +@section @code{GNAT.Serial_Communications} (@file{g-sercom.ads}) +@cindex @code{GNAT.Serial_Communications} (@file{g-sercom.ads}) +@cindex Serial_Communications + +@noindent +Provides a simple interface to send and receive data over a serial +port. This is only supported on GNU/Linux and Windows. + @node GNAT.SHA1 (g-sha1.ads) @section @code{GNAT.SHA1} (@file{g-sha1.ads}) @cindex @code{GNAT.SHA1} (@file{g-sha1.ads}) @@ -14010,49 +14193,6 @@ This package provides facilities for use in interfacing to C++. It is primarily intended to be used in connection with automated tools for the generation of C++ interfaces. -@node Interfaces.Os2lib (i-os2lib.ads) -@section @code{Interfaces.Os2lib} (@file{i-os2lib.ads}) -@cindex @code{Interfaces.Os2lib} (@file{i-os2lib.ads}) -@cindex Interfacing, to OS/2 -@cindex OS/2 interfacing - -@noindent -This package provides interface definitions to the OS/2 library. -It is a thin binding which is a direct translation of the -various @file{<bse@.h>} files. - -@node Interfaces.Os2lib.Errors (i-os2err.ads) -@section @code{Interfaces.Os2lib.Errors} (@file{i-os2err.ads}) -@cindex @code{Interfaces.Os2lib.Errors} (@file{i-os2err.ads}) -@cindex OS/2 Error codes -@cindex Interfacing, to OS/2 -@cindex OS/2 interfacing - -@noindent -This package provides definitions of the OS/2 error codes. - -@node Interfaces.Os2lib.Synchronization (i-os2syn.ads) -@section @code{Interfaces.Os2lib.Synchronization} (@file{i-os2syn.ads}) -@cindex @code{Interfaces.Os2lib.Synchronization} (@file{i-os2syn.ads}) -@cindex Interfacing, to OS/2 -@cindex Synchronization, OS/2 -@cindex OS/2 synchronization primitives - -@noindent -This is a child package that provides definitions for interfacing -to the @code{OS/2} synchronization primitives. - -@node Interfaces.Os2lib.Threads (i-os2thr.ads) -@section @code{Interfaces.Os2lib.Threads} (@file{i-os2thr.ads}) -@cindex @code{Interfaces.Os2lib.Threads} (@file{i-os2thr.ads}) -@cindex Interfacing, to OS/2 -@cindex Thread control, OS/2 -@cindex OS/2 thread interfacing - -@noindent -This is a child package that provides definitions for interfacing -to the @code{OS/2} thread primitives. - @node Interfaces.Packed_Decimal (i-pacdec.ads) @section @code{Interfaces.Packed_Decimal} (@file{i-pacdec.ads}) @cindex @code{Interfaces.Packed_Decimal} (@file{i-pacdec.ads}) @@ -14136,6 +14276,30 @@ This package provides facilities for partition interfacing. It is used primarily in a distribution context when using Annex E with @code{GLADE}. +@node System.Pool_Global (s-pooglo.ads) +@section @code{System.Pool_Global} (@file{s-pooglo.ads}) +@cindex @code{System.Pool_Global} (@file{s-pooglo.ads}) +@cindex Storage pool, global +@cindex Global storage pool + +@noindent +This package provides a storage pool that is equivalent to the default +storage pool used for access types for which no pool is specifically +declared. It uses malloc/free to allocate/free and does not attempt to +do any automatic reclamation. + +@node System.Pool_Local (s-pooloc.ads) +@section @code{System.Pool_Local} (@file{s-pooloc.ads}) +@cindex @code{System.Pool_Local} (@file{s-pooloc.ads}) +@cindex Storage pool, local +@cindex Local storage pool + +@noindent +This package provides a storage pool that is intended for use with locally +defined access types. It uses malloc/free for allocate/free, and maintains +a list of allocated blocks, so that all storage allocated for the pool can +be freed automatically when the pool is finalized. + @node System.Restrictions (s-restri.ads) @section @code{System.Restrictions} (@file{s-restri.ads}) @cindex @code{System.Restrictions} (@file{s-restri.ads}) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index daa7fcd4a81..69a2a3dd66e 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -6,7 +6,7 @@ @c o @c G N A T _ U G N o @c o -@c Copyright (C) 1992-2007, AdaCore o +@c Copyright (C) 1992-2008, AdaCore o @c o @c GNAT is free software; you can redistribute it and/or modify it under o @c terms of the GNU General Public License as published by the Free Soft- o @@ -89,7 +89,6 @@ @set EDITION GNAT @set DEFAULTLANGUAGEVERSION Ada 2005 @set NONDEFAULTLANGUAGEVERSION Ada 95 -@set FILE gnat_ugn @ifset unw @set PLATFORM @@ -102,7 +101,7 @@ @settitle @value{EDITION} User's Guide @value{PLATFORM} @dircategory GNU Ada tools @direntry -* @value{EDITION} User's Guide (@value{FILE}) @value{PLATFORM} +* @value{EDITION} User's Guide (gnat_ugn) @value{PLATFORM} @end direntry @include gcc-common.texi @@ -195,6 +194,9 @@ AdaCore@* * Creating Sample Bodies Using gnatstub:: * Other Utility Programs:: * Running and Debugging Ada Programs:: +@ifclear vms +* Code Coverage and Profiling:: +@end ifclear @ifset vms * Compatibility with HP Ada:: @end ifset @@ -503,6 +505,13 @@ Other Utility Programs * The External Symbol Naming Scheme of GNAT:: * Converting Ada Files to html with gnathtml:: +@ifclear vms +Code Coverage and Profiling + +* Code Coverage of Ada Programs using gcov:: +* Profiling an Ada Program using gprof:: +@end ifclear + Running and Debugging Ada Programs * The GNAT Debugger GDB:: @@ -587,6 +596,7 @@ Platform-Specific Information for the Run-Time Libraries * Solaris-Specific Considerations:: * Linux-Specific Considerations:: * AIX-Specific Considerations:: +* Irix-Specific Considerations:: Example of Binder Output File @@ -842,6 +852,12 @@ a utility that generates empty but compilable bodies for library units. @ref{Other Utility Programs}, discusses several other GNAT utilities, including @code{gnathtml}. +@ifclear vms +@item +@ref{Code Coverage and Profiling}, describes how to perform a structural +coverage and profile the execution of Ada programs. +@end ifclear + @item @ref{Running and Debugging Ada Programs}, describes how to run and debug Ada programs. @@ -5225,9 +5241,11 @@ This warning can also be turned on using @option{-gnatwa}. @item -gnatwW @emph{Suppress warnings on wrong low bound assumption.} @cindex @option{-gnatwW} (@command{gcc}) -This switch activates warnings for indexing an unconstrained string parameter -with a literal or S'Length. This warning can also be suppressed by providing -an Assert pragma that checks the low bound, for example: +This switch suppresses warnings for indexing an unconstrained string parameter +with a literal or S'Length. Note that this warning can also be suppressed +in a particular case by adding an +assertion that the lower bound is 1, +as shown in the following example. @smallexample @c ada procedure K (S : String) is @@ -5235,6 +5253,22 @@ an Assert pragma that checks the low bound, for example: @dots{} @end smallexample +@item -gnatw.w +@emph{Activate warnings on unnecessary Warnings Off pragmas} +@cindex @option{-gnatw.w} (@command{gcc}) +@cindex Warnings Off control +This switch activates warnings for use of @code{pragma Warnings (Off, entity} +where either the pragma is entirely useless (because it suppresses no +warnings), or it could be replaced by @code{pragma Unreferenced} or +@code{pragma Unmodified}.The default is that these warnings are not given. +Note that this warning is not included in -gnatwa, it must be +activated explicitly. + +@item -gnatw.W +@emph{Suppress warnings on unnecessary Warnings Off pragmas} +@cindex @option{-gnatw.W} (@command{gcc}) +This switch suppresses warnings for use of @code{pragma Warnings (Off, entity}. + @item -gnatwx @emph{Activate warnings on Export/Import pragmas.} @cindex @option{-gnatwx} (@command{gcc}) @@ -5297,7 +5331,9 @@ incompatibilities between Ada 95 and Ada 2005. This switch activates warnings for unchecked conversions where the types are known at compile time to have different sizes. The default -is that such warnings are generated. +is that such warnings are generated. Warnings are also +generated for subprogram pointers with different conventions, +and, on VMS only, for data pointers with different conventions. This warning can also be turned on using @option{-gnatwa}. @item -gnatwZ @@ -5305,7 +5341,7 @@ This warning can also be turned on using @option{-gnatwa}. @cindex @option{-gnatwZ} (@command{gcc}) This switch suppresses warnings for unchecked conversions where the types are known at compile time to have different -sizes. +sizes or conventions. @item ^-Wuninitialized^WARNINGS=UNINITIALIZED^ @cindex @option{-Wuninitialized} @@ -21535,6 +21571,10 @@ into the body stub. @cindex @option{^-hg^/HEADER=GENERAL^} (@command{gnatstub}) Put a sample comment header into the body stub. +@item ^--header-file=@var{filename}^/FROM_HEADER_FILE=@var{filename}^ +@cindex @option{^--header-file^/FROM_HEADER_FILE=^} (@command{gnatstub}) +Use the content of the file as the comment header for a generated body stub. + @ifclear vms @item -IDIR @cindex @option{-IDIR} (@command{gnatstub}) @@ -21888,6 +21928,291 @@ $ RUN/DEBUG <PROGRAM_NAME> @noindent @end ifset +@ifclear vms +@c ****************************** +@node Code Coverage and Profiling +@chapter Code Coverage and Profiling +@cindex Code Coverage +@cindex Profiling + +@noindent +This chapter describes how to use @code{gcov} - coverage testing tool - and +@code{gprof} - profiler tool - on your Ada programs. + +@menu +* Code Coverage of Ada Programs using gcov:: +* Profiling an Ada Program using gprof:: +@end menu + +@node Code Coverage of Ada Programs using gcov +@section Code Coverage of Ada Programs using gcov +@cindex gcov +@cindex -fprofile-arcs +@cindex -ftest-coverage +@cindex -coverage +@cindex Code Coverage + +@noindent +@code{gcov} is a test coverage program: it analyzes the execution of a given +program on selected tests, to help you determine the portions of the program +that are still untested. + +@code{gcov} is part of the GCC suite, and is described in detail in the GCC +User's Guide. You can refer to this documentation for a more complete +description. + +This chapter provides a quick startup guide, and +details some Gnat-specific features. + +@menu +* Quick startup guide:: +* Gnat specifics:: +@end menu + +@node Quick startup guide +@subsection Quick startup guide + +In order to perform coverage analysis of a program using @code{gcov}, 3 +steps are needed: + +@itemize @bullet +@item +Code instrumentation during the compilation process +@item +Execution of the instrumented program +@item +Execution of the @code{gcov} tool to generate the result. +@end itemize + +The code instrumentation needed by gcov is created at the object level: +The source code is not modified in any way, because the instrumentation code is +inserted by gcc during the compilation process. To compile your code with code +coverage activated, you need to recompile your whole project using the +switches +@code{-fprofile-arcs} and @code{-ftest-coverage}, and link it using +@code{-fprofile-arcs}. + +@smallexample +$ gnatmake -P my_project.gpr -f -cargs -fprofile-arcs -ftest-coverage \ + -largs -fprofile-arcs +@end smallexample + +This compilation process will create @file{.gcno} files together with +the usual object files. + +Once the program is compiled with coverage instrumentation, you can +run it as many times as needed - on portions of a test suite for +example. The first execution will produce @file{.gcda} files at the +same location as the @file{.gcno} files. The following executions +will update those files, so that a cumulative result of the covered +portions of the program is generated. + +Finaly, you need to call the @code{gcov} tool. The different options of +@code{gcov} are available in the GCC User's Guide, section 'Invoking gcov'. + +This will create anotated source files with a @file{.gcov} extension: +@file{my_main.adb} file will be analysed in @file{my_main.adb.gcov}. + +@node Gnat specifics +@subsection Gnat specifics + +Because Ada semantics, portions of the source code may be shared among +several object files. This is the case for example when generics are +involved, when inlining is active or when declarations generate initialisation +calls. In order to take +into account this shared code, you need to call @code{gcov} on all +source files of the tested program at once. + +The list of source files might exceed the system's maximum command line +length. In order to bypass this limitation, a new mechanism has been +implemented in @code{gcov}: you can now list all your project's files into a +text file, and provide this file to gcov as a parameter, preceded by a @@ +(e.g. @samp{gcov @@mysrclist.txt}). + +@node Profiling an Ada Program using gprof +@section Profiling an Ada Program using gprof +@cindex gprof +@cindex -pg +@cindex Profiling + +@noindent +This section is not meant to be an exhaustive documentation of @code{gprof}. +Full documentation for it can be found in the GNU Profiler User's Guide +documentation that is part of this GNAT distribution. + +Profiling a program helps determine the parts of a program that are executed +most often, and are therefore the most time-consuming. + +@code{gprof} is the standard GNU profiling tool; it has been enhanced to +better handle Ada programs and multitasking. +It is currently supported on the following platoforms +@itemize @bullet +@item +linux x86/x86_64 +@item +solaris sparc/sparc64/x86 +@item +windows x86 +@end itemize + +@noindent +In order to profile a program using @code{gprof}, 3 steps are needed: + +@itemize @bullet +@item +Code instrumentation, requiring a full recompilation of the project with the +proper switches. +@item +Execution of the program under the analysis conditions, i.e. with the desired +input. +@item +Analysis of the results using the @code{gprof} tool. +@end itemize + +@noindent +The following sections detail the different steps, and indicate how +to interpret the results: +@menu +* Compilation for profiling:: +* Program execution:: +* Running gprof:: +* Interpretation of profiling results:: +@end menu + +@node Compilation for profiling +@subsection Compilation for profiling +@cindex -pg +@cindex Profiling + +In order to profile a program the first step is to tell the compiler +to generate the necessary profiling information. The compiler switch to be used +is @code{-pg}, which must be added to other compilation switches. This +switch needs to be specified both during compilation and link stages, and can +be specified once when using gnatmake: + +@smallexample +gnatmake -f -pg -P my_project +@end smallexample + +@noindent +Note that only the objects that were compiled with the @samp{-pg} switch will be +profiled; if you need to profile your whole project, use the +@samp{-f} gnatmake switch to force full recompilation. + +@node Program execution +@subsection Program execution + +@noindent +Once the program has been compiled for profiling, you can run it as usual. + +The only constraint imposed by profiling is that the program must terminate +normally. An interrupted program (via a Ctrl-C, kill, etc.) will not be +properly analyzed. + +Once the program completes execution, a data file called @file{gmon.out} is +generated in the directory where the program was launched from. If this file +already exists, it will be overwritten. + +@node Running gprof +@subsection Running gprof + +@noindent +The @code{gprof} tool is called as follow: + +@smallexample +gprof my_prog gmon.out +@end smallexample + +@noindent +or simpler: + +@smallexample +gprof my_prog +@end smallexample + +@noindent +The complete form of the gprof command line is the following: + +@smallexample +gprof [^switches^options^] [executable [data-file]] +@end smallexample + +@noindent +@code{gprof} supports numerous ^switch^options^. The order of these +^switch^options^ does not matter. The full list of options can be found in +the GNU Profiler User's Guide documentation that comes with this documentation. + +The following is the subset of those switches that is most relevant: + +@table @option + +@item --demangle[=@var{style}] +@itemx --no-demangle +@cindex @option{--demangle} (@code{gprof}) +These options control whether symbol names should be demangled when +printing output. The default is to demangle C++ symbols. The +@code{--no-demangle} option may be used to turn off demangling. Different +compilers have different mangling styles. The optional demangling style +argument can be used to choose an appropriate demangling style for your +compiler, in particular Ada symbols generated by GNAT can be demangled using +@code{--demangle=gnat}. + +@item -e @var{function_name} +@cindex @option{-e} (@code{gprof}) +The @samp{-e @var{function}} option tells @code{gprof} not to print +information about the function @var{function_name} (and its +children@dots{}) in the call graph. The function will still be listed +as a child of any functions that call it, but its index number will be +shown as @samp{[not printed]}. More than one @samp{-e} option may be +given; only one @var{function_name} may be indicated with each @samp{-e} +option. + +@item -E @var{function_name} +@cindex @option{-E} (@code{gprof}) +The @code{-E @var{function}} option works like the @code{-e} option, but +execution time spent in the function (and children who were not called from +anywhere else), will not be used to compute the percentages-of-time for +the call graph. More than one @samp{-E} option may be given; only one +@var{function_name} may be indicated with each @samp{-E} option. + +@item -f @var{function_name} +@cindex @option{-f} (@code{gprof}) +The @samp{-f @var{function}} option causes @code{gprof} to limit the +call graph to the function @var{function_name} and its children (and +their children@dots{}). More than one @samp{-f} option may be given; +only one @var{function_name} may be indicated with each @samp{-f} +option. + +@item -F @var{function_name} +@cindex @option{-F} (@code{gprof}) +The @samp{-F @var{function}} option works like the @code{-f} option, but +only time spent in the function and its children (and their +children@dots{}) will be used to determine total-time and +percentages-of-time for the call graph. More than one @samp{-F} option +may be given; only one @var{function_name} may be indicated with each +@samp{-F} option. The @samp{-F} option overrides the @samp{-E} option. + +@end table + +@node Interpretation of profiling results +@subsection Interpretation of profiling results + +@noindent + +The results of the profiling analysis are represented by two arrays: the +'flat profile' and the 'call graph'. Full documentation of those outputs +can be found in the GNU Profiler User's Guide. + +The flat profile shows the time spent in each function of the program, and how +many time it has been called. This allows you to locate easily the most +time-consuming functions. + +The call graph shows, for each subprogram, the subprograms that call it, +and the subprograms that it calls. It also provides an estimate of the time +spent in each of those callers/called subprograms. +@end ifclear + +@c ****************************** @node Running and Debugging Ada Programs @chapter Running and Debugging Ada Programs @cindex Debugging @@ -24694,6 +25019,7 @@ information about several specific platforms. * Solaris-Specific Considerations:: * Linux-Specific Considerations:: * AIX-Specific Considerations:: +* Irix-Specific Considerations:: @end menu @node Summary of Run-Time Configurations @@ -25010,6 +25336,24 @@ occurs in the environment task, or use @code{pragma Storage_Size} to specify a sufficiently large size for the stack of the task that contains this call. +@node Irix-Specific Considerations +@section Irix-Specific Considerations +@cindex Irix libraries + +@noindent +The GCC support libraries coming with the Irix compiler have moved to +their canonical place with respect to the general Irix ABI related +conventions. Running applications built with the default shared GNAT +run-time now requires the LD_LIBRARY_PATH environment variable to +include this location. A possible way to achieve this is to issue the +following command line on a bash prompt: + +@smallexample +@group +$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`dirname \`gcc --print-file-name=libgcc_s.so\`` +@end group +@end smallexample + @c ******************************* @node Example of Binder Output File @appendix Example of Binder Output File diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index c664338ae87..8e527cc76ee 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -118,19 +118,22 @@ procedure GNATCmd is -- tool. We allocate objects because we cannot declare aliased objects -- as we are in a procedure, not a library level package. - Naming_String : constant String_Access := new String'("naming"); - Binder_String : constant String_Access := new String'("binder"); - Compiler_String : constant String_Access := new String'("compiler"); - Check_String : constant String_Access := new String'("check"); - Eliminate_String : constant String_Access := new String'("eliminate"); - Finder_String : constant String_Access := new String'("finder"); - Linker_String : constant String_Access := new String'("linker"); - Gnatls_String : constant String_Access := new String'("gnatls"); - Pretty_String : constant String_Access := new String'("pretty_printer"); - Stack_String : constant String_Access := new String'("stack"); - Gnatstub_String : constant String_Access := new String'("gnatstub"); - Metric_String : constant String_Access := new String'("metrics"); - Xref_String : constant String_Access := new String'("cross_reference"); + subtype SA is String_Access; + + Naming_String : constant SA := new String'("naming"); + Binder_String : constant SA := new String'("binder"); + Compiler_String : constant SA := new String'("compiler"); + Check_String : constant SA := new String'("check"); + Synchronize_String : constant SA := new String'("synchronize"); + Eliminate_String : constant SA := new String'("eliminate"); + Finder_String : constant SA := new String'("finder"); + Linker_String : constant SA := new String'("linker"); + Gnatls_String : constant SA := new String'("gnatls"); + Pretty_String : constant SA := new String'("pretty_printer"); + Stack_String : constant SA := new String'("stack"); + Gnatstub_String : constant SA := new String'("gnatstub"); + Metric_String : constant SA := new String'("metrics"); + Xref_String : constant SA := new String'("cross_reference"); Packages_To_Check_By_Binder : constant String_List_Access := new String_List'((Naming_String, Binder_String)); @@ -138,6 +141,9 @@ procedure GNATCmd is Packages_To_Check_By_Check : constant String_List_Access := new String_List'((Naming_String, Check_String, Compiler_String)); + Packages_To_Check_By_Sync : constant String_List_Access := + new String_List'((Naming_String, Synchronize_String, Compiler_String)); + Packages_To_Check_By_Eliminate : constant String_List_Access := new String_List'((Naming_String, Eliminate_String, Compiler_String)); @@ -549,8 +555,9 @@ procedure GNATCmd is end if; else - -- For gnatcheck, gnatpp and gnatmetric, put all sources - -- of the project, or of all projects if -U was specified. + -- For gnatcheck, gnatsync, gnatpp and gnatmetric, put all + -- sources of the project, or of all projects if -U was + -- specified. for Kind in Spec_Or_Body loop if Check_Project @@ -1561,6 +1568,7 @@ begin if The_Command = Bind or else The_Command = Check + or else The_Command = Sync or else The_Command = Elim or else The_Command = Find or else The_Command = Link @@ -1578,6 +1586,9 @@ begin when Check => Tool_Package_Name := Name_Check; Packages_To_Check := Packages_To_Check_By_Check; + when Sync => + Tool_Package_Name := Name_Synchronize; + Packages_To_Check := Packages_To_Check_By_Sync; when Elim => Tool_Package_Name := Name_Eliminate; Packages_To_Check := Packages_To_Check_By_Eliminate; @@ -1761,6 +1772,7 @@ begin elsif (The_Command = Check or else + The_Command = Sync or else The_Command = Pretty or else The_Command = Metric or else The_Command = Stack or else @@ -1776,6 +1788,7 @@ begin end if; elsif ((The_Command = Check and then Argv (Argv'First) /= '+') + or else The_Command = Sync or else The_Command = Metric or else The_Command = Pretty) and then Project_File /= null @@ -1938,6 +1951,7 @@ begin or else The_Command = Stub or else The_Command = Elim or else The_Command = Check + or else The_Command = Sync then -- If there are switches in package Compiler, put them in the -- Carg_Switches table. @@ -2295,8 +2309,8 @@ begin end; end if; - -- For gnat check, metric or pretty with -U + a main, get the list - -- of sources from the closure and add them to the arguments. + -- For gnat check, sync, metric or pretty with -U + a main, get the + -- list of sources from the closure and add them to the arguments. if ASIS_Main /= null then Get_Closure; @@ -2315,11 +2329,12 @@ begin (Project, Project_Tree, Including_Libraries => False); end if; - -- For gnat check, gnat pretty, gnat metric, gnat list, and gnat - -- stack, if no file has been put on the command line, call tool - -- with all the sources of the main project. + -- For gnat check, gnat sync, gnat pretty, gnat metric, gnat list, + -- and gnat stack, if no file has been put on the command line, call + -- tool with all the sources of the main project. elsif The_Command = Check or else + The_Command = Sync or else The_Command = Pretty or else The_Command = Metric or else The_Command = List or else diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads index b806f448eb9..530731330e0 100644 --- a/gcc/ada/gnatvsn.ads +++ b/gcc/ada/gnatvsn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -79,7 +79,7 @@ package Gnatvsn is -- value should never be decreased in the future, but it would be -- OK to increase it if absolutely necessary. - Library_Version : constant String := "4.3"; + Library_Version : constant String := "4.4"; -- Library version. This value must be updated whenever any change to the -- compiler affects the library formats in such a way as to obsolete -- previously compiled library modules. @@ -90,7 +90,7 @@ package Gnatvsn is Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version; -- Version string stored in e.g. ALI files. - Current_Year : constant String := "2007"; + Current_Year : constant String := "2008"; -- Used in printing copyright messages end Gnatvsn; diff --git a/gcc/ada/i-cstrin.ads b/gcc/ada/i-cstrin.ads index 5e3494ed1b6..152d292d737 100644 --- a/gcc/ada/i-cstrin.ads +++ b/gcc/ada/i-cstrin.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1993-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1993-2007, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index f9b1b2df901..bf85defa17a 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -42,13 +42,14 @@ package body Impunit is -- Ada 95 Units -- ------------------ - -- The following is a giant string list containing the names of all - -- non-implementation internal files, i.e. the complete list of files for + -- The following is a giant string list containing the names of all non- + -- implementation internal files, i.e. the complete list of files for -- internal units which a program may legitimately WITH when operating in -- either Ada 95 or Ada 05 mode. -- Note that this list should match the list of units documented in the - -- "GNAT Library" section of the GNAT Reference Manual. + -- "GNAT Library" section of the GNAT Reference Manual. A unit listed here + -- must either be documented in that section or described in the Ada RM. Non_Imp_File_Names_95 : constant File_List := ( @@ -160,7 +161,6 @@ package body Impunit is "a-ssicst", -- Ada.Streams.Stream_IO.C_Streams "a-suteio", -- Ada.Strings.Unbounded.Text_IO "a-swuwti", -- Ada.Strings.Wide_Unbounded.Wide_Text_IO - "a-taidim", -- Ada.Task_Identification.Image "a-tiocst", -- Ada.Text_IO.C_Streams "a-wtcstr", -- Ada.Wide_Text_IO.C_Streams @@ -175,14 +175,13 @@ package body Impunit is -- GNAT Special IO Units -- --------------------------- - -- As further explained elsewhere (see Sem_Ch10), the internal - -- packages of Text_IO and Wide_Text_IO are actually implemented - -- as separate children, but this fact is intended to be hidden - -- from the user completely. Any attempt to WITH one of these - -- units will be diagnosed as an error later on, but for now we - -- do not consider these internal implementation units (if we did, - -- then we would get a junk warning which would be confusing and - -- unecessary, given that we generate a clear error message). + -- As further explained elsewhere (see Sem_Ch10), the internal packages of + -- Text_IO and Wide_Text_IO are actually implemented as separate children, + -- but this fact is intended to be hidden from the user completely. Any + -- attempt to WITH one of these units will be diagnosed as an error later + -- on, but for now we do not consider these internal implementation units + -- (if we did, then we would get a junk warning which would be confusing + -- and unecessary, given that we generate a clear error message). "a-tideio", -- Ada.Text_IO.Decimal_IO "a-tienio", -- Ada.Text_IO.Enumeration_IO @@ -259,6 +258,7 @@ package body Impunit is "g-regist", -- GNAT.Registry "g-regpat", -- GNAT.Regpat "g-semaph", -- GNAT.Semaphores + "g-sercom", -- GNAT.Serial_Communications "g-sestin", -- GNAT.Secondary_Stack_Info "g-sha1 ", -- GNAT.SHA1 "g-signal", -- GNAT.Signals @@ -282,8 +282,6 @@ package body Impunit is "g-u3spch", -- GNAT.UTF_32_Spelling_Checker "g-wispch", -- GNAT.Wide_Spelling_Checker "g-wistsp", -- GNAT.Wide_String_Split - "g-zspche", -- GNAT.Wide_Wide_Spelling_Checker - "g-zstspl", -- GNAT.Wide_Wide_String_Split ----------------------------------------------------- -- Interface Hierarchy Units from Reference Manual -- diff --git a/gcc/ada/init.c b/gcc/ada/init.c index caf3adc98d7..81956c05b7b 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -1395,8 +1395,12 @@ __gnat_handle_vms_condition (int *sigargs, void *mechargs) #else exception = &constraint_error; msg = "arithmetic error"; +#ifndef __alpha__ + /* No need to adjust pc on alpha: the pc is already on the instruction + after the trapping one. */ __gnat_adjust_context_for_raise (0, (void *)mechargs); #endif +#endif break; default: diff --git a/gcc/ada/itypes.adb b/gcc/ada/itypes.adb index 125e6e2f149..cab817dfada 100644 --- a/gcc/ada/itypes.adb +++ b/gcc/ada/itypes.adb @@ -68,7 +68,7 @@ package body Itypes is Set_Is_Frozen (Typ); end if; - if Ekind in Access_Subprogram_Type_Kind then + if Ekind in Access_Subprogram_Kind then Set_Can_Use_Internal_Rep (Typ, not Always_Compatible_Rep_On_Target); end if; diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index a3ed7579451..d890012eabe 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -2794,7 +2794,32 @@ package body Layout is Align : Nat; begin - if Unknown_Alignment (E) then + -- If alignment is already set, then nothing to do + + if Known_Alignment (E) then + return; + end if; + + -- Alignment is not known, see if we can set it, taking into account + -- the setting of the Optimize_Alignment mode. + + -- If Optimize_Alignment is set to Space, then packed records always + -- have an aligmment of 1. But don't do anything for atomic records + -- since we may need higher alignment for indivisible access. + + if Optimize_Alignment = 'S' + and then Is_Record_Type (E) + and then Is_Packed (E) + and then not Is_Atomic (E) + then + Align := 1; + + -- Not a record, or not packed + + else + -- The only other cases we worry about here are where the size is + -- staticallly known at compile time. + if Known_Static_Esize (E) then Siz := Esize (E); @@ -2809,8 +2834,8 @@ package body Layout is -- Size is known, alignment is not set - -- Reset alignment to match size if size is exactly 2, 4, or 8 - -- storage units. + -- Reset alignment to match size if the known size is exactly 2, 4, + -- or 8 storage units. if Siz = 2 * System_Storage_Unit then Align := 2; @@ -2819,54 +2844,75 @@ package body Layout is elsif Siz = 8 * System_Storage_Unit then Align := 8; - -- On VMS, also reset for odd "in between" sizes, e.g. a 17-bit - -- record is given an alignment of 4. This is more consistent with - -- what DEC Ada does (-gnatd.a turns this off which can be used to - -- examine the value of this special transformation). + -- If Optimize_Alignment is set to Space, then make sure the + -- alignment matches the size, for example, if the size is 17 + -- bytes then we want an alignment of 1 for the type. + + elsif Optimize_Alignment = 'S' then + if Siz mod (8 * System_Storage_Unit) = 0 then + Align := 8; + elsif Siz mod (4 * System_Storage_Unit) = 0 then + Align := 4; + elsif Siz mod (2 * System_Storage_Unit) = 0 then + Align := 2; + else + Align := 1; + end if; + + -- If Optimize_Alignment is set to Time, then we reset for odd + -- "in between sizes", for example a 17 bit record is given an + -- alignment of 4. Note that this matches the old VMS behavior + -- in versions of GNAT prior to 6.1.1. - elsif OpenVMS_On_Target - and then not Debug_Flag_Dot_A + elsif Optimize_Alignment = 'T' and then Siz > System_Storage_Unit + and then Siz <= 8 * System_Storage_Unit then if Siz <= 2 * System_Storage_Unit then Align := 2; elsif Siz <= 4 * System_Storage_Unit then Align := 4; - elsif Siz <= 8 * System_Storage_Unit then + else -- Siz <= 8 * System_Storage_Unit then Align := 8; - else - return; end if; - -- No special alignment fiddling needed + -- No special alignment fiddling needed else return; end if; + end if; - -- Here Align is set to the proposed improved alignment + -- Here we have Set Align to the proposed improved value. Make sure the + -- value set does not exceed Maximum_Alignment for the target. - if Align > Maximum_Alignment then - Align := Maximum_Alignment; - end if; + if Align > Maximum_Alignment then + Align := Maximum_Alignment; + end if; - -- Further processing for record types only to reduce the alignment - -- set by the above processing in some specific cases. We do not - -- do this for atomic records, since we need max alignment there. + -- Further processing for record types only to reduce the alignment + -- set by the above processing in some specific cases. We do not + -- do this for atomic records, since we need max alignment there, - if Is_Record_Type (E) then + if Is_Record_Type (E) and then not Is_Atomic (E) then - -- For records, there is generally no point in setting alignment - -- higher than word size since we cannot do better than move by - -- words in any case + -- For records, there is generally no point in setting alignment + -- higher than word size since we cannot do better than move by + -- words in any case. Omit this if we are optimizing for time, + -- since conceivably we may be able to do better. - if Align > System_Word_Size / System_Storage_Unit then - Align := System_Word_Size / System_Storage_Unit; - end if; + if Align > System_Word_Size / System_Storage_Unit + and then Optimize_Alignment /= 'T' + then + Align := System_Word_Size / System_Storage_Unit; + end if; - -- Check components. If any component requires a higher - -- alignment, then we set that higher alignment in any case. + -- Check components. If any component requires a higher alignment, + -- then we set that higher alignment in any case. Don't do this if + -- we have Optimize_Alignment set to Space. Note that that covers + -- the case of packed records, where we arleady set alignment to 1. + if Optimize_Alignment /= 'S' then declare Comp : Entity_Id; @@ -2878,19 +2924,19 @@ package body Layout is Calign : constant Uint := Alignment (Etype (Comp)); begin - -- The cases to worry about are when the alignment - -- of the component type is larger than the alignment - -- we have so far, and either there is no component - -- clause for the alignment, or the length set by - -- the component clause matches the alignment set. + -- The cases to process are when the alignment of the + -- component type is larger than the alignment we have + -- so far, and either there is no component clause for + -- the component, or the length set by the component + -- clause matches the length of the component type. if Calign > Align and then (Unknown_Esize (Comp) - or else (Known_Static_Esize (Comp) - and then - Esize (Comp) = - Calign * System_Storage_Unit)) + or else (Known_Static_Esize (Comp) + and then + Esize (Comp) = + Calign * System_Storage_Unit)) then Align := UI_To_Int (Calign); end if; @@ -2901,16 +2947,17 @@ package body Layout is end loop; end; end if; + end if; - -- Set chosen alignment + -- Set chosen alignment, and increase Esize if necessary to match + -- the chosen alignment. - Set_Alignment (E, UI_From_Int (Align)); + Set_Alignment (E, UI_From_Int (Align)); - if Known_Static_Esize (E) - and then Esize (E) < Align * System_Storage_Unit - then - Set_Esize (E, UI_From_Int (Align * System_Storage_Unit)); - end if; + if Known_Static_Esize (E) + and then Esize (E) < Align * System_Storage_Unit + then + Set_Esize (E, UI_From_Int (Align * System_Storage_Unit)); end if; end Set_Composite_Alignment; diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index 40d5103e78e..bbc29ef3cd1 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -971,6 +971,11 @@ package body Lib.Writ is Write_Info_Str (" NS"); end if; + if Optimize_Alignment /= 'O' then + Write_Info_Str (" O"); + Write_Info_Char (Optimize_Alignment); + end if; + if Sec_Stack_Used then Write_Info_Str (" SS"); end if; diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads index b10d01eef26..ba46bf11831 100644 --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -209,7 +209,11 @@ package Lib.Writ is -- to all units in the file. -- -- NS Normalize_Scalars pragma in effect for all units in - -- this file + -- this file. + -- + -- OS Optimize_Alignment (Space) active for all units in this file + -- + -- OT Optimize_Alignment (Time) active for all units in this file -- -- Qx A valid Queueing_Policy pragma applies to all the units -- in this file, where x is the first character (upper case) @@ -498,15 +502,15 @@ package Lib.Writ is -- W unit-name [source-name lib-name] [E] [EA] [ED] [AD] -- -- One of these lines is present for each unit that is mentioned in - -- an explicit with clause by the current unit. The first parameter - -- is the unit name in internal format. The second parameter is the - -- file name of the file that must be compiled to compile this unit. - -- It is usually the file for the body, except for packages - -- which have no body; for units that need a body, if the source file - -- for the body cannot be found, the file name of the spec is used - -- instead. The third parameter is the file name of the library - -- information file that contains the results of compiling this unit. - -- The optional modifiers are used as follows: + -- an explicit with clause by the current unit. The first parameter is + -- the unit name in internal format. The second parameter is the file + -- name of the file that must be compiled to compile this unit. It is + -- usually the file for the body, except for packages which have no + -- body. For units that need a body, if the source file for the body + -- cannot be found, the file name of the spec is used instead. The + -- third parameter is the file name of the library information file + -- that contains the results of compiling this unit. The optional + -- modifiers are used as follows: -- -- E pragma Elaborate applies to this unit -- @@ -528,6 +532,8 @@ package Lib.Writ is -- of a generic unit compiled with earlier versions of GNAT which -- did not generate object or ali files for generics. + -- In fact W lines include implicit withs ??? + -- ----------------------- -- -- L Linker_Options -- -- ----------------------- diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 931049335e8..08254f3c910 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -235,6 +235,11 @@ package body Lib.Xref is -- -- Out param Same as above cases, but OUT parameter + function OK_To_Set_Referenced return Boolean; + -- Returns True if the Referenced flag can be set. There are a few + -- exceptions where we do not want to set this flag, see body for + -- details of these exceptional cases. + --------------- -- Is_On_LHS -- --------------- @@ -310,6 +315,41 @@ package body Lib.Xref is return Name (Parent (N)) = N; end Is_On_LHS; + --------------------------- + -- OK_To_Set_Referenced -- + --------------------------- + + function OK_To_Set_Referenced return Boolean is + P : Node_Id; + + begin + -- A reference from a pragma Unreferenced or pragma Unmodified or + -- pragma Warnings does not cause the Referenced flag to be set. + -- This avoids silly warnings about things being referenced and + -- not assigned when the only reference is from the pragma. + + if Nkind (N) = N_Identifier then + P := Parent (N); + + if Nkind (P) = N_Pragma_Argument_Association then + P := Parent (P); + + if Nkind (P) = N_Pragma then + if Pragma_Name (P) = Name_Warnings + or else + Pragma_Name (P) = Name_Unmodified + or else + Pragma_Name (P) = Name_Unreferenced + then + return False; + end if; + end if; + end if; + end if; + + return True; + end OK_To_Set_Referenced; + -- Start of processing for Generate_Reference begin @@ -527,9 +567,9 @@ package body Lib.Xref is Set_Referenced_As_LHS (E, False); end if; - -- Any other occurrence counts as referencing the entity + -- Any other occurrence counts as referencing the entity - else + elsif OK_To_Set_Referenced then Set_Referenced (E); -- If variable, this is an OK reference after an assignment diff --git a/gcc/ada/mlib-tgt.ads b/gcc/ada/mlib-tgt.ads index ad31788a2a2..8dba49e3e94 100644 --- a/gcc/ada/mlib-tgt.ads +++ b/gcc/ada/mlib-tgt.ads @@ -23,11 +23,11 @@ -- -- ------------------------------------------------------------------------------ --- This package provides a set of target dependent routines to build --- static, dynamic and shared libraries. There are several packages --- providing the actual routines; this package calls them indirectly --- by means of access-to-subprogram values; each target-dependent --- package initializes these values in its elaboration block. +-- This package provides a set of target dependent routines to build static, +-- dynamic and shared libraries. There are several packages providing +-- the actual routines. This package calls them indirectly by means of +-- access-to-subprogram values. Each target-dependent package initializes +-- these values in its elaboration block. with Prj; use Prj; diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb index df1969b4281..64460f60ff6 100644 --- a/gcc/ada/opt.adb +++ b/gcc/ada/opt.adb @@ -56,6 +56,7 @@ package body Opt is External_Name_Exp_Casing_Config := External_Name_Exp_Casing; External_Name_Imp_Casing_Config := External_Name_Imp_Casing; Fast_Math_Config := Fast_Math; + Optimize_Alignment_Config := Optimize_Alignment; Persistent_BSS_Mode_Config := Persistent_BSS_Mode; Polling_Required_Config := Polling_Required; Use_VADS_Size_Config := Use_VADS_Size; @@ -77,6 +78,7 @@ package body Opt is External_Name_Exp_Casing := Save.External_Name_Exp_Casing; External_Name_Imp_Casing := Save.External_Name_Imp_Casing; Fast_Math := Save.Fast_Math; + Optimize_Alignment := Save.Optimize_Alignment; Persistent_BSS_Mode := Save.Persistent_BSS_Mode; Polling_Required := Save.Polling_Required; Use_VADS_Size := Save.Use_VADS_Size; @@ -98,6 +100,7 @@ package body Opt is Save.External_Name_Exp_Casing := External_Name_Exp_Casing; Save.External_Name_Imp_Casing := External_Name_Imp_Casing; Save.Fast_Math := Fast_Math; + Save.Optimize_Alignment := Optimize_Alignment; Save.Persistent_BSS_Mode := Persistent_BSS_Mode; Save.Polling_Required := Polling_Required; Save.Use_VADS_Size := Use_VADS_Size; @@ -125,6 +128,7 @@ package body Opt is Extensions_Allowed := True; External_Name_Exp_Casing := As_Is; External_Name_Imp_Casing := Lowercase; + Optimize_Alignment := 'O'; Persistent_BSS_Mode := False; Use_VADS_Size := False; @@ -151,12 +155,14 @@ package body Opt is External_Name_Exp_Casing := External_Name_Exp_Casing_Config; External_Name_Imp_Casing := External_Name_Imp_Casing_Config; Fast_Math := Fast_Math_Config; + Optimize_Alignment := Optimize_Alignment_Config; Persistent_BSS_Mode := Persistent_BSS_Mode_Config; Use_VADS_Size := Use_VADS_Size_Config; end if; Exception_Locations_Suppressed := Exception_Locations_Suppressed_Config; Fast_Math := Fast_Math_Config; + Optimize_Alignment := Optimize_Alignment_Config; Polling_Required := Polling_Required_Config; end Set_Opt_Config_Switches; diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index decd1cc4609..b795a3c240e 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -858,6 +858,10 @@ package Opt is -- error is detected then this flag is reset from Generate_Code to -- Check_Semantics after generating an error message. + Optimize_Alignment : Character := 'O'; + -- Settinng of Optimize_Alignment, set to T/S/O for time/space/off. Can + -- be modified by use of pragma Optimize_Alignment. + Original_Operating_Mode : Operating_Mode_Type := Generate_Code; -- GNAT -- Indicates the original operating mode of the compiler as set by @@ -1298,6 +1302,12 @@ package Opt is -- which have a record representation clause but this component does not -- have a component clause. The default is that this warning is disabled. + Warn_On_Warnings_Off : Boolean := False; + -- GNAT + -- Set to True to generate warnings for use of Pragma Warnings (Off, ent), + -- where either the pragma is never used, or it could be replaced by a + -- pragma Unmodified or Unreferenced. + type Warning_Mode_Type is (Suppress, Normal, Treat_As_Error); Warning_Mode : Warning_Mode_Type := Normal; -- GNAT, GNATBIND @@ -1338,8 +1348,8 @@ package Opt is -- These are settings that are used to establish the mode at the start of -- each unit. The values defined below can be affected either by command - -- line switches, or by the use of appropriate configuration pragmas in the - -- gnat.adc file. + -- line switches, or by the use of appropriate configuration pragmas in a + -- configuration pragma file. Ada_Version_Config : Ada_Version_Type; -- GNAT @@ -1416,6 +1426,14 @@ package Opt is -- used to set the initial value of Fast_Math at the start of each new -- compilation unit. + Optimize_Alignment_Config : Character; + -- GNAT + -- This is the value of the configuration switch that controls the + -- alignment optimization mode, as set by an Optimize_Alignment pragma. + -- It is used to set the initial value of Optimize_Alignment at the start + -- of each new compilation unit, except that it is always set to 'O' (off) + -- for internal units. + Persistent_BSS_Mode_Config : Boolean; -- GNAT -- This is the value of the configuration switch that controls whether @@ -1553,6 +1571,7 @@ private External_Name_Exp_Casing : External_Casing_Type; External_Name_Imp_Casing : External_Casing_Type; Fast_Math : Boolean; + Optimize_Alignment : Character; Persistent_BSS_Mode : Boolean; Polling_Required : Boolean; Use_VADS_Size : Boolean; diff --git a/gcc/ada/osint-c.adb b/gcc/ada/osint-c.adb index a3d5b0ac8ca..541178da938 100644 --- a/gcc/ada/osint-c.adb +++ b/gcc/ada/osint-c.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -315,14 +315,21 @@ package body Osint.C is -- Remove extension preparing to replace it declare - Name : constant String := Name_Buffer (1 .. Dot_Index); + Name : String := Name_Buffer (1 .. Dot_Index); First : Positive; begin Name_Buffer (1 .. Output_Object_File_Name'Length) := Output_Object_File_Name.all; - Dot_Index := 0; + -- Put two names in canonical case, to allow object file names + -- with upper-case letters on Windows. + + Canonical_Case_File_Name (Name); + Canonical_Case_File_Name + (Name_Buffer (1 .. Output_Object_File_Name'Length)); + + Dot_Index := 0; for J in reverse Output_Object_File_Name'Range loop if Name_Buffer (J) = '.' then Dot_Index := J; diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 8fad13e3532..0a31616351e 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -150,7 +150,7 @@ package body Ch10 is Item := P_Pragma; if Item = Error - or else Chars (Item) /= Name_Source_Reference + or else Pragma_Name (Item) /= Name_Source_Reference then Restore_Scan_State (Scan_State); @@ -180,7 +180,8 @@ package body Ch10 is Item := P_Pragma; if Item = Error - or else not Is_Configuration_Pragma_Name (Chars (Item)) + or else not + Is_Configuration_Pragma_Name (Pragma_Name (Item)) then Restore_Scan_State (Scan_State); exit; @@ -1024,10 +1025,7 @@ package body Ch10 is Set_Name (Subunit_Node, P_Qualified_Simple_Name); U_Right_Paren; - if Token = Tok_Semicolon then - Error_Msg_SC ("unexpected semicolon ignored"); - Scan; - end if; + Ignore (Tok_Semicolon); if Token = Tok_Function or else Token = Tok_Procedure then Body_Node := P_Subprogram (Pf_Pbod); diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb index 697cf86d834..718afcc6a12 100644 --- a/gcc/ada/par-ch2.adb +++ b/gcc/ada/par-ch2.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -241,8 +241,8 @@ package body Ch2 is -- Set True if an identifier is encountered for a pragma argument. Used -- to check that there are no more arguments without identifiers. - Pragma_Node : Node_Id; - Pragma_Name : Name_Id; + Prag_Node : Node_Id; + Prag_Name : Name_Id; Semicolon_Loc : Source_Ptr; Ident_Node : Node_Id; Assoc_Node : Node_Id; @@ -280,9 +280,9 @@ package body Ch2 is -- Start of processing for P_Pragma begin - Pragma_Node := New_Node (N_Pragma, Token_Ptr); + Prag_Node := New_Node (N_Pragma, Token_Ptr); Scan; -- past PRAGMA - Pragma_Name := Token_Name; + Prag_Name := Token_Name; if Style_Check then Style.Check_Pragma_Name; @@ -294,21 +294,20 @@ package body Ch2 is if Ada_Version >= Ada_05 and then Token = Tok_Interface then - Pragma_Name := Name_Interface; + Prag_Name := Name_Interface; Ident_Node := Make_Identifier (Token_Ptr, Name_Interface); Scan; -- past INTERFACE else Ident_Node := P_Identifier; end if; - Set_Chars (Pragma_Node, Pragma_Name); - Set_Pragma_Identifier (Pragma_Node, Ident_Node); + Set_Pragma_Identifier (Prag_Node, Ident_Node); -- See if special INTERFACE/IMPORT check is required if SIS_Entry_Active then - Interface_Check_Required := (Pragma_Name = Name_Interface); - Import_Check_Required := (Pragma_Name = Name_Import); + Interface_Check_Required := (Prag_Name = Name_Interface); + Import_Check_Required := (Prag_Name = Name_Import); else Interface_Check_Required := False; Import_Check_Required := False; @@ -322,7 +321,7 @@ package body Ch2 is or else (Token /= Tok_Semicolon and then not Token_Is_At_Start_Of_Line) then - Set_Pragma_Argument_Associations (Pragma_Node, New_List); + Set_Pragma_Argument_Associations (Prag_Node, New_List); T_Left_Paren; loop @@ -342,7 +341,7 @@ package body Ch2 is end if; end if; - Append (Assoc_Node, Pragma_Argument_Associations (Pragma_Node)); + Append (Assoc_Node, Pragma_Argument_Associations (Prag_Node)); exit when Token /= Tok_Comma; Scan; -- past comma end loop; @@ -352,7 +351,7 @@ package body Ch2 is -- statement, and an assignment statement is the most likely -- candidate for this error) - if Token = Tok_Colon_Equal and then Pragma_Name = Name_Debug then + if Token = Tok_Colon_Equal and then Prag_Name = Name_Debug then Error_Msg_SC ("argument for pragma Debug must be procedure call"); Resync_To_Semicolon; @@ -378,13 +377,13 @@ package body Ch2 is -- case of pragma Source_File_Name, which assume the semicolon -- is already scanned out. - if Chars (Pragma_Node) = Name_Style_Checks then - Result := Par.Prag (Pragma_Node, Semicolon_Loc); + if Prag_Name = Name_Style_Checks then + Result := Par.Prag (Prag_Node, Semicolon_Loc); Skip_Pragma_Semicolon; return Result; else Skip_Pragma_Semicolon; - return Par.Prag (Pragma_Node, Semicolon_Loc); + return Par.Prag (Prag_Node, Semicolon_Loc); end if; exception @@ -434,14 +433,18 @@ package body Ch2 is -- Error recovery: Cannot raise Error_Resync procedure P_Pragmas_Opt (List : List_Id) is - P : Node_Id; + P : Node_Id; begin while Token = Tok_Pragma loop P := P_Pragma; - if Chars (P) = Name_Assert or else Chars (P) = Name_Debug then - Error_Msg_Name_1 := Chars (P); + if Nkind (P) /= N_Error + and then (Pragma_Name (P) = Name_Assert + or else + Pragma_Name (P) = Name_Debug) + then + Error_Msg_Name_1 := Pragma_Name (P); Error_Msg_N ("pragma% must be in declaration/statement context", P); else diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 10c3c85ff44..7889cd85a93 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -1316,7 +1316,7 @@ package body Ch3 is Check_Misspelling_Of (Tok_Renames); if Token = Tok_Renames then - Error_Msg_SP ("extra "":"" ignored"); + Error_Msg_SP ("|extra "":"" ignored"); Scan; -- past RENAMES return True; else @@ -2290,7 +2290,7 @@ package body Ch3 is -- Handle decimal fixed-point defn with DIGITS/DELTA in wrong order if Token = Tok_Delta then - Error_Msg_SC ("DELTA must come before DIGITS"); + Error_Msg_SC ("|DELTA must come before DIGITS"); Def_Node := New_Node (N_Decimal_Fixed_Point_Definition, Digits_Loc); Scan; -- past DELTA Set_Delta_Expression (Def_Node, P_Expression_No_Right_Paren); @@ -3542,7 +3542,7 @@ package body Ch3 is else begin Expr_Node := P_Expression_Or_Range_Attribute; - Check_No_Right_Paren; + Ignore (Tok_Right_Paren); if Token = Tok_Colon and then Nkind (Expr_Node) = N_Identifier @@ -4176,7 +4176,7 @@ package body Ch3 is -- Otherwise we saved the semicolon position, so complain else - Error_Msg (""";"" should be IS", SIS_Semicolon_Sloc); + Error_Msg ("|"";"" should be IS", SIS_Semicolon_Sloc); end if; -- The next job is to fix up any declarations that occurred diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 0db6d20a2ba..93c8f9ea988 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -32,9 +32,7 @@ with Stringt; use Stringt; separate (Par) package body Ch4 is - --------------- - -- Local map -- - --------------- + -- Attributes that cannot have arguments Is_Parameterless_Attribute : constant Attribute_Class_Array := (Attribute_Body_Version => True, @@ -51,6 +49,14 @@ package body Ch4 is -- list because it may denote a slice operation (X'Img (1 .. 2)) or -- a type conversion (X'Class (Y)). + -- Note that this map designates the minimum set of attributes where a + -- construct in parentheses that is not an argument can appear right + -- after the attribute. For attributes like 'Size, we do not put them + -- in the map. If someone writes X'Size (3), that's illegal in any case, + -- but we get a better error message by parsing the (3) as an illegal + -- argument to the attribute, rather than some meaningless junk that + -- follows the attribute. + ----------------------- -- Local Subprograms -- ----------------------- @@ -405,7 +411,7 @@ package body Ch4 is begin if Token_Is_At_Start_Of_Line then Restore_Scan_State (Scan_State); -- to apostrophe - Error_Msg_SC ("""''"" should be "";"""); + Error_Msg_SC ("|""''"" should be "";"""); Token := Tok_Semicolon; return True; else @@ -501,11 +507,12 @@ package body Ch4 is Set_Prefix (Name_Node, Prefix_Node); Set_Attribute_Name (Name_Node, Attr_Name); - -- Scan attribute arguments/designator + -- Scan attribute arguments/designator. We skip this if we know + -- that the attribute cannot have an argument. if Token = Tok_Left_Paren - and then - not Is_Parameterless_Attribute (Get_Attribute_Id (Attr_Name)) + and then not + Is_Parameterless_Attribute (Get_Attribute_Id (Attr_Name)) then Set_Expressions (Name_Node, New_List); Scan; -- past left paren @@ -1599,7 +1606,7 @@ package body Ch4 is function P_Expression_No_Right_Paren return Node_Id is Expr : constant Node_Id := P_Expression; begin - Check_No_Right_Paren; + Ignore (Tok_Right_Paren); return Expr; end P_Expression_No_Right_Paren; @@ -2332,7 +2339,7 @@ package body Ch4 is return P_Identifier; elsif Prev_Token = Tok_Comma then - Error_Msg_SP ("extra "","" ignored"); + Error_Msg_SP ("|extra "","" ignored"); raise Error_Resync; else @@ -2430,7 +2437,7 @@ package body Ch4 is begin if Token = Tok_Box then - Error_Msg_SC ("""'<'>"" should be ""/="""); + Error_Msg_SC ("|""'<'>"" should be ""/="""); end if; Op_Kind := Relop_Node (Token); diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index 577a6c0d93b..a2318406a7e 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -203,10 +203,7 @@ package body Ch5 is Statement_Required := SS_Flags.Sreq; loop - while Token = Tok_Semicolon loop - Error_Msg_SC ("unexpected semicolon ignored"); - Scan; -- past junk semicolon - end loop; + Ignore (Tok_Semicolon); begin if Style_Check then @@ -565,10 +562,7 @@ package body Ch5 is -- Skip junk right parens in this context - while Token = Tok_Right_Paren loop - Error_Msg_SC ("extra right paren"); - Scan; -- past ) - end loop; + Ignore (Tok_Right_Paren); -- Check context following call @@ -2200,7 +2194,7 @@ package body Ch5 is -- What we are interested in is whether it was a case of a bad IS. if Scope.Table (Scope.Last + 1).Etyp = E_Bad_Is then - Error_Msg ("IS should be "";""", Scope.Table (Scope.Last + 1).S_Is); + Error_Msg ("|IS should be "";""", Scope.Table (Scope.Last + 1).S_Is); Set_Bad_Is_Detected (Parent, True); end if; @@ -2235,7 +2229,7 @@ package body Ch5 is if Token = Tok_And or else Token = Tok_Or then Error_Msg_SC ("unexpected logical operator"); - Scan; + Scan; -- past logical operator if (Prev_Token = Tok_And and then Token = Tok_Then) or else diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index b2ae242c517..2fc0ace4945 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -64,9 +64,8 @@ package body Ch6 is if Token = Tok_Return then Restore_Scan_State (Scan_State); - Error_Msg_SC ("unexpected semicolon ignored"); + Error_Msg_SC ("|extra "";"" ignored"); Scan; -- rescan past junk semicolon - else Restore_Scan_State (Scan_State); end if; @@ -265,11 +264,7 @@ package body Ch6 is end if; Scope.Table (Scope.Last).Labl := Name_Node; - - if Token = Tok_Colon then - Error_Msg_SC ("redundant colon ignored"); - Scan; -- past colon - end if; + Ignore (Tok_Colon); -- Deal with generic instantiation, the one case in which we do not -- have a subprogram specification as part of whatever we are parsing @@ -411,6 +406,19 @@ package body Ch6 is Discard_Junk_Node (P_Expression); end if; + -- Deal with semicolon followed by IS. We want to treat this as IS + + if Token = Tok_Semicolon then + Save_Scan_State (Scan_State); + Scan; -- past semicolon + + if Token = Tok_Is then + Error_Msg_SP ("extra "";"" ignored"); + else + Restore_Scan_State (Scan_State); + end if; + end if; + -- Deal with case of semicolon ending a subprogram declaration if Token = Tok_Semicolon then @@ -424,8 +432,8 @@ package body Ch6 is -- semicolon, and go process the body. if Token = Tok_Is then - Error_Msg_SP ("unexpected semicolon ignored"); - T_Is; -- ignroe redundant IS's + Error_Msg_SP ("|extra "";"" ignored"); + T_Is; -- scan past IS goto Subprogram_Body; -- If BEGIN follows in an appropriate column, we immediately @@ -436,7 +444,7 @@ package body Ch6 is elsif Token = Tok_Begin and then Start_Column >= Scope.Table (Scope.Last).Ecol then - Error_Msg_SP (""";"" should be IS!"); + Error_Msg_SP ("|"";"" should be IS!"); goto Subprogram_Body; else @@ -540,7 +548,7 @@ package body Ch6 is -- semicolon which should really be an IS else - Error_Msg_AP ("missing "";"""); + Error_Msg_AP ("|missing "";"""); SIS_Missing_Semicolon_Message := Get_Msg_Id; goto Subprogram_Declaration; end if; @@ -1203,7 +1211,7 @@ package body Ch6 is -- that semicolon should have been a right parenthesis and exit if Token = Tok_Is or else Token = Tok_Return then - Error_Msg_SP ("expected "")"" in place of "";"""); + Error_Msg_SP ("|"";"" should be "")"""); exit Specification_Loop; end if; diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb index 453b9ab69f8..241b2db54ef 100644 --- a/gcc/ada/par-ch9.adb +++ b/gcc/ada/par-ch9.adb @@ -154,7 +154,7 @@ package body Ch9 is Scan; -- past semicolon if Token = Tok_Entry then - Error_Msg_SP (""";"" should be IS"); + Error_Msg_SP ("|"";"" should be IS"); Set_Task_Definition (Task_Node, P_Task_Definition); else Pop_Scope_Stack; -- Remove unused entry @@ -371,6 +371,7 @@ package body Ch9 is Name_Node : Node_Id; Protected_Node : Node_Id; Protected_Sloc : Source_Ptr; + Scan_State : Saved_Scan_State; begin Push_Scope_Stack; @@ -439,6 +440,35 @@ package body Ch9 is Scope.Table (Scope.Last).Labl := Name_Node; end if; + -- Check for semicolon not followed by IS, this is something like + + -- protected type r; + + -- where we want + + -- protected type r IS END; + + if Token = Tok_Semicolon then + Save_Scan_State (Scan_State); -- at semicolon + Scan; -- past semicolon + + if Token /= Tok_Is then + Restore_Scan_State (Scan_State); + Error_Msg_SC ("missing IS"); + Set_Protected_Definition (Protected_Node, + Make_Protected_Definition (Token_Ptr, + Visible_Declarations => Empty_List, + End_Label => Empty)); + + SIS_Entry_Active := False; + End_Statements (Protected_Definition (Protected_Node)); + Scan; -- past semicolon + return Protected_Node; + end if; + + Error_Msg_SP ("|extra ""("" ignored"); + end if; + T_Is; -- Ada 2005 (AI-345) @@ -1081,7 +1111,7 @@ package body Ch9 is Bnode := P_Expression_No_Right_Paren; if Token = Tok_Colon_Equal then - Error_Msg_SC (""":="" should be ""="""); + Error_Msg_SC ("|"":="" should be ""="""); Scan; Bnode := P_Expression_No_Right_Paren; end if; diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 5f49f9f82bd..973968df199 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,8 +43,8 @@ with System.WCh_Con; use System.WCh_Con; separate (Par) function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is - Pragma_Name : constant Name_Id := Chars (Pragma_Node); - Prag_Id : constant Pragma_Id := Get_Pragma_Id (Pragma_Name); + Prag_Name : constant Name_Id := Pragma_Name (Pragma_Node); + Prag_Id : constant Pragma_Id := Get_Pragma_Id (Prag_Name); Pragma_Sloc : constant Source_Ptr := Sloc (Pragma_Node); Arg_Count : Nat; Arg_Node : Node_Id; @@ -241,10 +241,10 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is end loop; end Process_Restrictions_Or_Restriction_Warnings; --- Start if processing for Prag +-- Start of processing for Prag begin - Error_Msg_Name_1 := Pragma_Name; + Error_Msg_Name_1 := Prag_Name; -- Ignore unrecognized pragma. We let Sem post the warning for this, since -- it is a semantic error, not a syntactic one (we have already checked @@ -626,7 +626,7 @@ begin -- Source_File_Name_Project pragmas. begin - if Get_Pragma_Id (Pragma_Name) = Pragma_Source_File_Name then + if Prag_Id = Pragma_Source_File_Name then if Project_File_In_Use = In_Use then Error_Msg ("pragma Source_File_Name cannot be used " & @@ -1135,6 +1135,7 @@ begin Pragma_No_Strict_Aliasing | Pragma_Normalize_Scalars | Pragma_Optimize | + Pragma_Optimize_Alignment | Pragma_Pack | Pragma_Passive | Pragma_Preelaborable_Initialization | diff --git a/gcc/ada/par-tchk.adb b/gcc/ada/par-tchk.adb index 3d45932c49f..3ec1a2bea06 100644 --- a/gcc/ada/par-tchk.adb +++ b/gcc/ada/par-tchk.adb @@ -83,11 +83,11 @@ package body Tchk is -- A little recovery helper, accept then in place of => elsif Token = Tok_Then then - Error_Msg_BC ("missing ""='>"""); + Error_Msg_BC ("|THEN should be ""='>"""); Scan; -- past THEN used in place of => elsif Token = Tok_Colon_Equal then - Error_Msg_SC (""":="" should be ""='>"""); + Error_Msg_SC ("|"":="" should be ""='>"""); Scan; -- past := used in place of => else @@ -149,15 +149,15 @@ package body Tchk is Scan; elsif Token = Tok_Equal then - Error_Msg_SC ("""="" should be "":="""); + Error_Msg_SC ("|""="" should be "":="""); Scan; elsif Token = Tok_Colon then - Error_Msg_SC (""":"" should be "":="""); + Error_Msg_SC ("|"":"" should be "":="""); Scan; elsif Token = Tok_Is then - Error_Msg_SC ("IS should be "":="""); + Error_Msg_SC ("|IS should be "":="""); Scan; else @@ -257,25 +257,39 @@ package body Tchk is procedure T_Is is begin + Ignore (Tok_Semicolon); + + -- If we have IS scan past it + if Token = Tok_Is then Scan; + -- And ignore any following semicolons + Ignore (Tok_Semicolon); -- Allow OF, => or = to substitute for IS with complaint - elsif Token = Tok_Arrow - or else Token = Tok_Of - or else Token = Tok_Equal - then - Error_Msg_SC ("missing IS"); - Scan; -- token used in place of IS + elsif Token = Tok_Arrow then + Error_Msg_SC ("|""=>"" should be IS"); + Scan; -- past => + + elsif Token = Tok_Of then + Error_Msg_SC ("|OF should be IS"); + Scan; -- past OF + + elsif Token = Tok_Equal then + Error_Msg_SC ("|""="" should be IS"); + Scan; -- past = + else Wrong_Token (Tok_Is, AP); end if; + -- Ignore extra IS keywords + while Token = Tok_Is loop - Error_Msg_SC ("extra IS ignored"); + Error_Msg_SC ("|extra IS ignored"); Scan; end loop; end T_Is; @@ -379,7 +393,7 @@ package body Tchk is if Token = Tok_Right_Paren then Scan; else - Error_Msg_AP ("missing "")"""); + Error_Msg_AP ("|missing "")"""); end if; end T_Right_Paren; @@ -394,24 +408,24 @@ package body Tchk is Scan; if Token = Tok_Semicolon then - Error_Msg_SC ("extra "";"" ignored"); + Error_Msg_SC ("|extra "";"" ignored"); Scan; end if; return; elsif Token = Tok_Colon then - Error_Msg_SC (""":"" should be "";"""); + Error_Msg_SC ("|"":"" should be "";"""); Scan; return; elsif Token = Tok_Comma then - Error_Msg_SC (""","" should be "";"""); + Error_Msg_SC ("|"","" should be "";"""); Scan; return; elsif Token = Tok_Dot then - Error_Msg_SC ("""."" should be "";"""); + Error_Msg_SC ("|""."" should be "";"""); Scan; return; @@ -434,7 +448,7 @@ package body Tchk is return; -- Deal with pragma. If pragma is not at start of line, it is considered - -- misplaced otherwise we treat it as a normal missing semicolong case. + -- misplaced otherwise we treat it as a normal missing semicolon case. elsif Token = Tok_Pragma and then not Token_Is_At_Start_Of_Line @@ -812,7 +826,7 @@ package body Tchk is if Token = Tok_Right_Paren then Scan; else - Error_Msg_AP ("missing "")""!"); + Error_Msg_AP ("|missing "")""!"); end if; end U_Right_Paren; @@ -831,7 +845,7 @@ package body Tchk is Scan; if Token = T then - Error_Msg_SP ("extra "";"" ignored"); + Error_Msg_SP ("|extra "";"" ignored"); Scan; else Error_Msg_SP (M); @@ -841,7 +855,7 @@ package body Tchk is Scan; if Token = T then - Error_Msg_SP ("extra "","" ignored"); + Error_Msg_SP ("|extra "","" ignored"); Scan; else diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb index e4b690f1788..98f66c66ab8 100644 --- a/gcc/ada/par-util.adb +++ b/gcc/ada/par-util.adb @@ -109,7 +109,7 @@ package body Util is and then S = Name_Buffer (1 .. SL) then Scan_Ptr := Token_Ptr + S'Length; - Error_Msg_S ("missing space"); + Error_Msg_S ("|missing space"); Token := T; return True; end if; @@ -176,18 +176,6 @@ package body Util is end if; end Check_Misspelling_Of; - -------------------------- - -- Check_No_Right_Paren -- - -------------------------- - - procedure Check_No_Right_Paren is - begin - if Token = Tok_Right_Paren then - Error_Msg_SC ("unexpected right parenthesis"); - Scan; -- past unexpected right paren - end if; - end Check_No_Right_Paren; - ----------------------------- -- Check_Simple_Expression -- ----------------------------- @@ -343,7 +331,7 @@ package body Util is <<Assume_Comma>> Restore_Scan_State (Scan_State); - Error_Msg_SC (""";"" illegal here, replaced by "","""); + Error_Msg_SC ("|"";"" should be "","""); Scan; -- past the semicolon return True; @@ -391,38 +379,33 @@ package body Util is procedure Ignore (T : Token_Type) is begin - if Token = T then + while Token = T loop if T = Tok_Comma then - Error_Msg_SC ("unexpected "","" ignored"); + Error_Msg_SC ("|extra "","" ignored"); elsif T = Tok_Left_Paren then - Error_Msg_SC ("unexpected ""("" ignored"); + Error_Msg_SC ("|extra ""("" ignored"); elsif T = Tok_Right_Paren then - Error_Msg_SC ("unexpected "")"" ignored"); + Error_Msg_SC ("|extra "")"" ignored"); elsif T = Tok_Semicolon then - Error_Msg_SC ("unexpected "";"" ignored"); + Error_Msg_SC ("|extra "";"" ignored"); + + elsif T = Tok_Colon then + Error_Msg_SC ("|extra "":"" ignored"); else declare Tname : constant String := Token_Type'Image (Token); - Msg : String := "unexpected keyword ????????????????????????"; - begin - -- Loop to copy characters of keyword name (ignoring Tok_) - - for J in 5 .. Tname'Last loop - Msg (J + 14) := Fold_Upper (Tname (J)); - end loop; - - Msg (Tname'Last + 15 .. Tname'Last + 22) := " ignored"; - Error_Msg_SC (Msg (1 .. Tname'Last + 22)); + Error_Msg_SC + ("|extra " & Tname (5 .. Tname'Last) & "ignored"); end; end if; Scan; -- Scan past ignored token - end if; + end loop; end Ignore; ---------------------------- @@ -438,7 +421,6 @@ package body Util is declare Ident_Casing : constant Casing_Type := Identifier_Casing (Current_Source_File); - Key_Casing : constant Casing_Type := Keyword_Casing (Current_Source_File); diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index e75051002eb..016d5024846 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1050,10 +1050,6 @@ is -- it is returned unchanged. Otherwise an error message is issued -- and Error is returned. - procedure Check_No_Right_Paren; - -- Called to check that the current token is not a right paren. If it - -- is, then an error is given, and the right parenthesis is scanned out. - function Comma_Present return Boolean; -- Used in comma delimited lists to determine if a comma is present, or -- can reasonably be assumed to have been present (an error message is @@ -1256,10 +1252,10 @@ begin -- Give error if bad pragma - if not Is_Configuration_Pragma_Name (Chars (P_Node)) - and then Chars (P_Node) /= Name_Source_Reference + if not Is_Configuration_Pragma_Name (Pragma_Name (P_Node)) + and then Pragma_Name (P_Node) /= Name_Source_Reference then - if Is_Pragma_Name (Chars (P_Node)) then + if Is_Pragma_Name (Pragma_Name (P_Node)) then Error_Msg_N ("only configuration pragmas allowed " & "in configuration file", P_Node); diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 0f3fef4a722..c340b293244 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -260,6 +260,12 @@ package body Prj.Attr is "Ladefault_switches#" & "Lbswitches#" & + -- package Synchronize + + "Psynchronize#" & + "Ladefault_switches#" & + "Lbswitches#" & + -- package Eliminate "Peliminate#" & @@ -296,9 +302,38 @@ package body Prj.Attr is Initialized : Boolean := False; -- A flag to avoid multiple initialization + Package_Names : String_List_Access := new Strings.String_List (1 .. 20); + Last_Package_Name : Natural := 0; + -- Package_Names (1 .. Last_Package_Name) contains the list of the known + -- package names, coming from the Initialization_Data string or from + -- calls to one of the two procedures Register_New_Package. + + procedure Add_Package_Name (Name : String); + -- Add a package name in the Package_Name list, extending it, if necessary + function Name_Id_Of (Name : String) return Name_Id; -- Returns the Name_Id for Name in lower case + ---------------------- + -- Add_Package_Name -- + ---------------------- + + procedure Add_Package_Name (Name : String) is + begin + if Last_Package_Name = Package_Names'Last then + declare + New_List : constant Strings.String_List_Access := + new Strings.String_List (1 .. Package_Names'Last * 2); + begin + New_List (Package_Names'Range) := Package_Names.all; + Package_Names := New_List; + end; + end if; + + Last_Package_Name := Last_Package_Name + 1; + Package_Names (Last_Package_Name) := new String'(Name); + end Add_Package_Name; + ----------------------- -- Attribute_Kind_Of -- ----------------------- @@ -433,6 +468,8 @@ package body Prj.Attr is First_Attribute => Empty_Attr); Start := Finish + 1; + Add_Package_Name (Get_Name_String (Package_Name)); + when 'S' => Var_Kind := Single; Optional_Index := False; @@ -594,6 +631,15 @@ package body Prj.Attr is end if; end Optional_Index_Of; + ----------------------- + -- Package_Name_List -- + ----------------------- + + function Package_Name_List return Strings.String_List is + begin + return Package_Names (1 .. Last_Package_Name); + end Package_Name_List; + ------------------------ -- Package_Node_Id_Of -- ------------------------ @@ -729,6 +775,8 @@ package body Prj.Attr is (Name => Pkg_Name, Known => True, First_Attribute => Empty_Attr); + + Add_Package_Name (Get_Name_String (Pkg_Name)); end Register_New_Package; procedure Register_New_Package @@ -805,6 +853,8 @@ package body Prj.Attr is (Name => Pkg_Name, Known => True, First_Attribute => First_Attr); + + Add_Package_Name (Get_Name_String (Pkg_Name)); end Register_New_Package; --------------------------- diff --git a/gcc/ada/prj-attr.ads b/gcc/ada/prj-attr.ads index 135878e25c2..2d314b6cbb3 100644 --- a/gcc/ada/prj-attr.ads +++ b/gcc/ada/prj-attr.ads @@ -28,10 +28,18 @@ -- It is also possible to define new packages with their attributes +with System.Strings; with Table; package Prj.Attr is + use System; + + function Package_Name_List return Strings.String_List; + -- Returns the list of valid package names, including those added by + -- procedures Register_New_Package below. The String_Access components of + -- the returned String_List should never be feeed. + procedure Initialize; -- Initialize the predefined project level attributes and the predefined -- packages and their attribute. This procedure should be called by diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb index 24c312e70ee..f9528d0de9a 100644 --- a/gcc/ada/prj-dect.adb +++ b/gcc/ada/prj-dect.adb @@ -25,7 +25,8 @@ with Err_Vars; use Err_Vars; -with GNAT.Case_Util; use GNAT.Case_Util; +with GNAT.Case_Util; use GNAT.Case_Util; +with GNAT.Spelling_Checker; use GNAT.Spelling_Checker; with Opt; use Opt; with Prj.Attr; use Prj.Attr; @@ -36,8 +37,12 @@ with Prj.Tree; use Prj.Tree; with Snames; with Uintp; use Uintp; +with System.Strings; + package body Prj.Dect is + use System; + type Zone is (In_Project, In_Package, In_Case_Construction); -- Used to indicate if we are parsing a package (In_Package), -- a case construction (In_Case_Construction) or none of those two @@ -983,11 +988,44 @@ package body Prj.Dect is if Current_Package = Empty_Package then if not Quiet_Output then - Error_Msg ("?""" & - Get_Name_String - (Name_Of (Package_Declaration, In_Tree)) & - """ is not a known package name", - Token_Ptr); + declare + List : constant Strings.String_List := Package_Name_List; + Index : Natural; + Name : constant String := Get_Name_String (Token_Name); + + begin + -- Check for possible misspelling of a known package name + + Index := 0; + loop + if Index >= List'Last then + Index := 0; + exit; + end if; + + Index := Index + 1; + exit when + GNAT.Spelling_Checker.Is_Bad_Spelling_Of + (Name, List (Index).all); + end loop; + + -- Issue warning(s) in verbose mode or when a possible + -- misspelling has been found. + + if Verbose_Mode or else Index /= 0 then + Error_Msg ("?""" & + Get_Name_String + (Name_Of (Package_Declaration, In_Tree)) & + """ is not a known package name", + Token_Ptr); + end if; + + if Index /= 0 then + Error_Msg ("\?possible misspelling of """ & + List (Index).all & """", + Token_Ptr); + end if; + end; end if; -- Set the package declaration to "ignored" so that it is not diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index ecad20dd8c2..76b507e9a46 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -174,14 +174,13 @@ package body Prj.Nmsc is Hash => Hash, Equal => "="); -- A hash table to store the excluded files, if any. This is filled by - -- Find_Excluded_Sources below + -- Find_Excluded_Sources below. procedure Find_Excluded_Sources (In_Tree : Project_Tree_Ref; Data : Project_Data); -- Find the list of files that should not be considered as source files - -- for this project. - -- Sets the list in the Excluded_Sources_Htable + -- for this project. Sets the list in the Excluded_Sources_Htable. function Hash (Unit : Unit_Info) return Header_Num; @@ -199,8 +198,8 @@ package body Prj.Nmsc is Key => Unit_Info, Hash => Hash, Equal => "="); - -- A table to check if a unit with an exceptional name will hide - -- a source with a file name following the naming convention. + -- A table to check if a unit with an exceptional name will hide a source + -- with a file name following the naming convention. procedure Add_Source (Id : out Source_Id; @@ -274,14 +273,14 @@ package body Prj.Nmsc is -- In_Tree and modify its data Data if it has the value "true". procedure Check_Library_Attributes - (Project : Project_Id; - In_Tree : Project_Tree_Ref; + (Project : Project_Id; + In_Tree : Project_Tree_Ref; Current_Dir : String; - Data : in out Project_Data); + Data : in out Project_Data); -- Check the library attributes of project Project in project tree In_Tree -- and modify its data Data accordingly. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Check_Package_Naming (Project : Project_Id; @@ -315,7 +314,7 @@ package body Prj.Nmsc is -- Check if project Project in project tree In_Tree is a Stand-Alone -- Library project, and modify its data Data accordingly if it is one. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Get_Path_Names_And_Record_Ada_Sources (Project : Project_Id; @@ -327,7 +326,7 @@ package body Prj.Nmsc is function Compute_Directory_Last (Dir : String) return Natural; -- Return the index of the last significant character in Dir. This is used - -- to avoid duplicates '/' at the end of directory names + -- to avoid duplicate '/' (slash) characters at the end of directory names. procedure Error_Msg (Project : Project_Id; @@ -345,7 +344,7 @@ package body Prj.Nmsc is Current_Dir : String); -- Find all the Ada sources in all of the source directories of a project -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Find_Sources (Project : Project_Id; @@ -362,9 +361,9 @@ package body Prj.Nmsc is Data : in out Project_Data; For_All_Sources : Boolean); -- Search the source directories to find the sources. - -- If For_All_Sources is True, check each regular file name against - -- the naming schemes of the different languages. Otherwise consider - -- only the file names in the hash table Source_Names. + -- If For_All_Sources is True, check each regular file name against the + -- naming schemes of the different languages. Otherwise consider only the + -- file names in the hash table Source_Names. procedure Check_File (Project : Project_Id; @@ -424,7 +423,7 @@ package body Prj.Nmsc is -- Get the object directory, the exec directory and the source directories -- of a project. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Get_Mains (Project : Project_Id; @@ -449,8 +448,8 @@ package body Prj.Nmsc is Data : in out Project_Data); -- Process the Source_Files and Source_List_File attributes, and store -- the list of source files into the Source_Names htable. - -- Lang indicates which language is being processed when in Ada_Only - -- mode (all languages are processed anyway when in Multi_Language mode) + -- Lang indicates which language is being processed when in Ada_Only mode + -- (all languages are processed anyway when in Multi_Language mode). procedure Get_Unit (In_Tree : Project_Tree_Ref; @@ -461,16 +460,16 @@ package body Prj.Nmsc is Unit_Kind : out Spec_Or_Body; Needs_Pragma : out Boolean); -- Find out, from a file name, the unit name, the unit kind and if a - -- specific SFN pragma is needed. If the file name corresponds to no - -- unit, then Unit_Name will be No_Name. If the file is a multi-unit source - -- or an exception to the naming scheme, then Exception_Id is set to - -- the unit or units that the source contains. + -- specific SFN pragma is needed. If the file name corresponds to no unit, + -- then Unit_Name will be No_Name. If the file is a multi-unit source or an + -- exception to the naming scheme, then Exception_Id is set to the unit or + -- units that the source contains. function Is_Illegal_Suffix (Suffix : String; Dot_Replacement_Is_A_Single_Dot : Boolean) return Boolean; - -- Returns True if the string Suffix cannot be used as - -- a spec suffix, a body suffix or a separate suffix. + -- Returns True if the string Suffix cannot be used as a spec suffix, a + -- body suffix or a separate suffix. procedure Locate_Directory (Project : Project_Id; @@ -490,7 +489,7 @@ package body Prj.Nmsc is -- the directory. If the directory does not exist and Project_Setup is -- false, then Dir and Display are set to No_Name. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Look_For_Sources (Project : Project_Id; @@ -500,7 +499,7 @@ package body Prj.Nmsc is -- Find all the sources of project Project in project tree In_Tree and -- update its Data accordingly. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. function Path_Name_Of (File_Name : File_Name_Type; @@ -535,7 +534,7 @@ package body Prj.Nmsc is -- Put a unit in the list of units of a project, if the file name -- corresponds to a valid unit name. -- Current_Dir should represent the current directory, and is passed for - -- efficiency to avoid system calls to recompute it + -- efficiency to avoid system calls to recompute it. procedure Record_Other_Sources (Project : Project_Id; @@ -553,6 +552,7 @@ package body Prj.Nmsc is Project : Project_Id; Data : in out Project_Data; In_Tree : Project_Tree_Ref); + -- ??? needs comment procedure Report_No_Sources (Project : Project_Id; @@ -579,8 +579,8 @@ package body Prj.Nmsc is Conventions : Array_Element_Id; Specs : Boolean; Extending : Boolean); - -- Check that individual naming conventions apply to immediate - -- sources of the project; if not, issue a warning. + -- Check that individual naming conventions apply to immediate sources of + -- the project. If not, issue a warning. ---------------- -- Add_Source -- @@ -642,7 +642,8 @@ package body Prj.Nmsc is Src_Data.Display_File := Display_File; Src_Data.Dependency := In_Tree.Languages_Data.Table (Lang_Id).Config.Dependency_Kind; - Src_Data.Dep_Name := Dependency_Name (File_Name, Src_Data.Dependency); + Src_Data.Dep_Name := + Dependency_Name (File_Name, Src_Data.Dependency); Src_Data.Switches := Switches_Name (File_Name); Src_Data.Naming_Exception := Naming_Exception; diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb index 3c46138d60d..a7864c5df81 100644 --- a/gcc/ada/prj-part.adb +++ b/gcc/ada/prj-part.adb @@ -72,13 +72,16 @@ package body Prj.Part is Table_Increment => 100, Table_Name => "Prj.Part.Withs"); -- Table used to store temporarily paths and locations of imported - -- projects. These imported projects will be effectively parsed after the - -- name of the current project has been extablished. + -- projects. These imported projects will be effectively parsed later: just + -- before parsing the current project for the non limited withed projects, + -- after getting its name; after complete parsing of the current project + -- for the limited withed projects. type Names_And_Id is record Path_Name : Path_Name_Type; Canonical_Path_Name : Path_Name_Type; Id : Project_Node_Id; + Limited_With : Boolean; end record; package Project_Stack is new Table.Table @@ -147,25 +150,28 @@ package body Prj.Part is procedure Pre_Parse_Context_Clause (In_Tree : Project_Node_Tree_Ref; Context_Clause : out With_Id); - -- Parse the context clause of a project. - -- Store the paths and locations of the imported projects in table Withs. - -- Does nothing if there is no context clause (if the current - -- token is not "with" or "limited" followed by "with"). + -- Parse the context clause of a project. Store the paths and locations of + -- the imported projects in table Withs. Does nothing if there is no + -- context clause (if the current token is not "with" or "limited" followed + -- by "with"). procedure Post_Parse_Context_Clause (Context_Clause : With_Id; In_Tree : Project_Node_Tree_Ref; - Imported_Projects : out Project_Node_Id; + Limited_Withs : Boolean; + Imported_Projects : in out Project_Node_Id; Project_Directory : Path_Name_Type; From_Extended : Extension_Origin; In_Limited : Boolean; Packages_To_Check : String_List_Access; Depth : Natural; Current_Dir : String); - -- Parse the imported projects that have been stored in table Withs, - -- if any. From_Extended is used for the call to Parse_Single_Project - -- below. When In_Limited is True, the importing path includes at least - -- one "limited with". + -- Parse the imported projects that have been stored in table Withs, if + -- any. From_Extended is used for the call to Parse_Single_Project below. + -- When In_Limited is True, the importing path includes at least one + -- "limited with". When Limited_Withs is False, only non limited withed + -- projects are parsed. When Limited_Withs is True, only limited withed + -- projects are parsed. function Project_Path_Name_Of (Project_File_Name : String; @@ -645,7 +651,7 @@ package body Prj.Part is Comma_Loop : loop - Scan (In_Tree); -- scan past WITH or "," + Scan (In_Tree); -- past WITH or "," Expect (Tok_String_Literal, "literal string"); @@ -682,7 +688,7 @@ package body Prj.Part is -- End of (possibly multiple) with clause; - Scan (In_Tree); -- scan past the semicolon. + Scan (In_Tree); -- past the semicolon exit Comma_Loop; elsif Token = Tok_Comma then @@ -707,7 +713,8 @@ package body Prj.Part is procedure Post_Parse_Context_Clause (Context_Clause : With_Id; In_Tree : Project_Node_Tree_Ref; - Imported_Projects : out Project_Node_Id; + Limited_Withs : Boolean; + Imported_Projects : in out Project_Node_Id; Project_Directory : Path_Name_Type; From_Extended : Extension_Origin; In_Limited : Boolean; @@ -717,7 +724,7 @@ package body Prj.Part is is Current_With_Clause : With_Id := Context_Clause; - Current_Project : Project_Node_Id := Empty_Node; + Current_Project : Project_Node_Id := Imported_Projects; Previous_Project : Project_Node_Id := Empty_Node; Next_Project : Project_Node_Id := Empty_Node; @@ -725,163 +732,177 @@ package body Prj.Part is Get_Name_String (Project_Directory); Current_With : With_Record; - Limited_With : Boolean := False; Extends_All : Boolean := False; begin - Imported_Projects := Empty_Node; + -- Set Current_Project to the last project in the current list, if the + -- list is not empty. + + if Current_Project /= Empty_Node then + while + Next_With_Clause_Of (Current_Project, In_Tree) /= Empty_Node + loop + Current_Project := Next_With_Clause_Of (Current_Project, In_Tree); + end loop; + end if; while Current_With_Clause /= No_With loop Current_With := Withs.Table (Current_With_Clause); Current_With_Clause := Current_With.Next; - Limited_With := In_Limited or Current_With.Limited_With; - - declare - Original_Path : constant String := - Get_Name_String (Current_With.Path); - - Imported_Path_Name : constant String := - Project_Path_Name_Of - (Original_Path, Project_Directory_Path); - - Resolved_Path : constant String := - Normalize_Pathname - (Imported_Path_Name, - Directory => Current_Dir, - Resolve_Links => Opt.Follow_Links_For_Files, - Case_Sensitive => True); - - Withed_Project : Project_Node_Id := Empty_Node; + if Limited_Withs = Current_With.Limited_With then + declare + Original_Path : constant String := + Get_Name_String (Current_With.Path); - begin - if Imported_Path_Name = "" then + Imported_Path_Name : constant String := + Project_Path_Name_Of + (Original_Path, + Project_Directory_Path); - -- The project file cannot be found + Resolved_Path : constant String := + Normalize_Pathname + (Imported_Path_Name, + Directory => Current_Dir, + Resolve_Links => + Opt.Follow_Links_For_Files, + Case_Sensitive => True); - Error_Msg_File_1 := File_Name_Type (Current_With.Path); + Withed_Project : Project_Node_Id := Empty_Node; - Error_Msg ("unknown project file: {", Current_With.Location); + begin + if Imported_Path_Name = "" then - -- If this is not imported by the main project file, - -- display the import path. + -- The project file cannot be found - if Project_Stack.Last > 1 then - for Index in reverse 1 .. Project_Stack.Last loop - Error_Msg_File_1 := - File_Name_Type (Project_Stack.Table (Index).Path_Name); - Error_Msg ("\imported by {", Current_With.Location); - end loop; - end if; + Error_Msg_File_1 := File_Name_Type (Current_With.Path); + Error_Msg + ("unknown project file: {", Current_With.Location); - else - -- New with clause + -- If this is not imported by the main project file, display + -- the import path. - Previous_Project := Current_Project; + if Project_Stack.Last > 1 then + for Index in reverse 1 .. Project_Stack.Last loop + Error_Msg_File_1 := + File_Name_Type + (Project_Stack.Table (Index).Path_Name); + Error_Msg + ("\imported by {", Current_With.Location); + end loop; + end if; - if Current_Project = Empty_Node then + else + -- New with clause - -- First with clause of the context clause + Previous_Project := Current_Project; - Current_Project := Current_With.Node; - Imported_Projects := Current_Project; + if Current_Project = Empty_Node then - else - Next_Project := Current_With.Node; - Set_Next_With_Clause_Of - (Current_Project, In_Tree, Next_Project); - Current_Project := Next_Project; - end if; + -- First with clause of the context clause - Set_String_Value_Of - (Current_Project, In_Tree, Name_Id (Current_With.Path)); - Set_Location_Of - (Current_Project, In_Tree, Current_With.Location); + Current_Project := Current_With.Node; + Imported_Projects := Current_Project; - -- If this is a "limited with", check if we have a circularity. - -- If we have one, get the project id of the limited imported - -- project file, and do not parse it. + else + Next_Project := Current_With.Node; + Set_Next_With_Clause_Of + (Current_Project, In_Tree, Next_Project); + Current_Project := Next_Project; + end if; - if Limited_With and then Project_Stack.Last > 1 then - declare - Canonical_Path_Name : Path_Name_Type; + Set_String_Value_Of + (Current_Project, + In_Tree, + Name_Id (Current_With.Path)); + Set_Location_Of + (Current_Project, In_Tree, Current_With.Location); + + -- If it is a limited with, check if we have a circularity. + -- If we have one, get the project id of the limited + -- imported project file, and do not parse it. + + if Limited_Withs and then Project_Stack.Last > 1 then + declare + Canonical_Path_Name : Path_Name_Type; + + begin + Name_Len := Resolved_Path'Length; + Name_Buffer (1 .. Name_Len) := Resolved_Path; + Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); + Canonical_Path_Name := Name_Find; + + for Index in 1 .. Project_Stack.Last loop + if Project_Stack.Table (Index).Canonical_Path_Name = + Canonical_Path_Name + then + -- We have found the limited imported project, + -- get its project id, and do not parse it. - begin - Name_Len := Resolved_Path'Length; - Name_Buffer (1 .. Name_Len) := Resolved_Path; - Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); - Canonical_Path_Name := Name_Find; + Withed_Project := Project_Stack.Table (Index).Id; + exit; + end if; + end loop; + end; + end if; - for Index in 1 .. Project_Stack.Last loop - if Project_Stack.Table (Index).Canonical_Path_Name = - Canonical_Path_Name - then - -- We have found the limited imported project, - -- get its project id, and do not parse it. + -- Parse the imported project, if its project id is unknown - Withed_Project := Project_Stack.Table (Index).Id; - exit; - end if; - end loop; - end; - end if; + if Withed_Project = Empty_Node then + Parse_Single_Project + (In_Tree => In_Tree, + Project => Withed_Project, + Extends_All => Extends_All, + Path_Name => Imported_Path_Name, + Extended => False, + From_Extended => From_Extended, + In_Limited => Limited_Withs, + Packages_To_Check => Packages_To_Check, + Depth => Depth, + Current_Dir => Current_Dir); - -- Parse the imported project, if its project id is unknown - - if Withed_Project = Empty_Node then - Parse_Single_Project - (In_Tree => In_Tree, - Project => Withed_Project, - Extends_All => Extends_All, - Path_Name => Imported_Path_Name, - Extended => False, - From_Extended => From_Extended, - In_Limited => Limited_With, - Packages_To_Check => Packages_To_Check, - Depth => Depth, - Current_Dir => Current_Dir); + else + Extends_All := Is_Extending_All (Withed_Project, In_Tree); + end if; - else - Extends_All := Is_Extending_All (Withed_Project, In_Tree); - end if; + if Withed_Project = Empty_Node then - if Withed_Project = Empty_Node then - -- If parsing was not successful, remove the - -- context clause. + -- If parsing unsuccessful, remove the context clause - Current_Project := Previous_Project; + Current_Project := Previous_Project; - if Current_Project = Empty_Node then - Imported_Projects := Empty_Node; + if Current_Project = Empty_Node then + Imported_Projects := Empty_Node; + else + Set_Next_With_Clause_Of + (Current_Project, In_Tree, Empty_Node); + end if; else - Set_Next_With_Clause_Of - (Current_Project, In_Tree, Empty_Node); - end if; - else - -- If parsing was successful, record project name - -- and path name in with clause - - Set_Project_Node_Of - (Node => Current_Project, - In_Tree => In_Tree, - To => Withed_Project, - Limited_With => Current_With.Limited_With); - Set_Name_Of - (Current_Project, - In_Tree, - Name_Of (Withed_Project, In_Tree)); + -- If parsing was successful, record project name and + -- path name in with clause + + Set_Project_Node_Of + (Node => Current_Project, + In_Tree => In_Tree, + To => Withed_Project, + Limited_With => Current_With.Limited_With); + Set_Name_Of + (Current_Project, + In_Tree, + Name_Of (Withed_Project, In_Tree)); - Name_Len := Resolved_Path'Length; - Name_Buffer (1 .. Name_Len) := Resolved_Path; - Set_Path_Name_Of (Current_Project, In_Tree, Name_Find); + Name_Len := Resolved_Path'Length; + Name_Buffer (1 .. Name_Len) := Resolved_Path; + Set_Path_Name_Of (Current_Project, In_Tree, Name_Find); - if Extends_All then - Set_Is_Extending_All (Current_Project, In_Tree); + if Extends_All then + Set_Is_Extending_All (Current_Project, In_Tree); + end if; end if; end if; - end if; - end; + end; + end if; end loop; end Post_Parse_Context_Clause; @@ -909,17 +930,16 @@ package body Prj.Part is Extending : Boolean := False; - Extended_Project : Project_Node_Id := Empty_Node; + Extended_Project : Project_Node_Id := Empty_Node; A_Project_Name_And_Node : Tree_Private_Part.Project_Name_And_Node := Tree_Private_Part.Projects_Htable.Get_First (In_Tree.Projects_HT); - Name_From_Path : constant Name_Id := Project_Name_From (Path_Name); - - Name_Of_Project : Name_Id := No_Name; - - First_With : With_Id; + Name_From_Path : constant Name_Id := Project_Name_From (Path_Name); + Name_Of_Project : Name_Id := No_Name; + First_With : With_Id; + Imported_Projects : Project_Node_Id := Empty_Node; use Tree_Private_Part; @@ -939,7 +959,6 @@ package body Prj.Part is Directory => Current_Dir, Resolve_Links => Opt.Follow_Links_For_Files, Case_Sensitive => False); - begin Name_Len := Normed_Path'Length; Name_Buffer (1 .. Name_Len) := Normed_Path; @@ -951,7 +970,9 @@ package body Prj.Part is -- Check for a circular dependency - for Index in 1 .. Project_Stack.Last loop + for Index in reverse 1 .. Project_Stack.Last loop + exit when Project_Stack.Table (Index).Limited_With; + if Canonical_Path_Name = Project_Stack.Table (Index).Canonical_Path_Name then @@ -982,10 +1003,11 @@ package body Prj.Part is -- Put the new path name on the stack - Project_Stack.Increment_Last; - Project_Stack.Table (Project_Stack.Last).Path_Name := Normed_Path_Name; - Project_Stack.Table (Project_Stack.Last).Canonical_Path_Name := - Canonical_Path_Name; + Project_Stack.Append + ((Path_Name => Normed_Path_Name, + Canonical_Path_Name => Canonical_Path_Name, + Id => Empty_Node, + Limited_With => In_Limited)); -- Check if the project file has already been parsed @@ -1009,9 +1031,9 @@ package body Prj.Part is Extends_All := Is_Extending_All (A_Project_Name_And_Node.Node, In_Tree); - -- If the imported project is an extended project A, - -- and we are in an extended project, replace A with the - -- ultimate project extending A. + -- If the imported project is an extended project A, and we are + -- in an extended project, replace A with the ultimate project + -- extending A. if From_Extended /= None then declare @@ -1048,8 +1070,8 @@ package body Prj.Part is Tree_Private_Part.Projects_Htable.Get_Next (In_Tree.Projects_HT); end loop; - -- We never encountered this project file - -- Save the scan state, load the project file and start to scan it. + -- We never encountered this project file. Save the scan state, load the + -- project file and start to scan it. Save_Project_Scan_State (Project_Scan_State); Source_Index := Load_Project_File (Path_Name); @@ -1069,8 +1091,8 @@ package body Prj.Part is if (not In_Configuration) and then (Name_From_Path = No_Name) then - -- The project file name is not correct (no or bad extension, - -- or not following Ada identifier's syntax). + -- The project file name is not correct (no or bad extension, or not + -- following Ada identifier's syntax). Error_Msg_File_1 := File_Name_Type (Canonical_Path_Name); Error_Msg ("?{ is not a valid path name for a project file", @@ -1084,24 +1106,27 @@ package body Prj.Part is Write_Eol; end if; + Project_Directory := Immediate_Directory_Of (Normed_Path_Name); + -- Is there any imported project? - Pre_Parse_Context_Clause (In_Tree, First_With); + Pre_Parse_Context_Clause + (In_Tree => In_Tree, + Context_Clause => First_With); - Project_Directory := Immediate_Directory_Of (Normed_Path_Name); Project := Default_Project_Node (Of_Kind => N_Project, In_Tree => In_Tree); Project_Stack.Table (Project_Stack.Last).Id := Project; Set_Directory_Of (Project, In_Tree, Project_Directory); Set_Path_Name_Of (Project, In_Tree, Normed_Path_Name); Set_Location_Of (Project, In_Tree, Token_Ptr); - + Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects); Expect (Tok_Project, "PROJECT"); -- Mark location of PROJECT token if present if Token = Tok_Project then - Scan (In_Tree); -- scan past PROJECT + Scan (In_Tree); -- past PROJECT Set_Location_Of (Project, In_Tree, Token_Ptr); end if; @@ -1156,7 +1181,7 @@ package body Prj.Part is Extending := True; - Scan (In_Tree); -- scan past EXTENDS + Scan (In_Tree); -- past EXTENDS if Token = Tok_All then Extends_All := True; @@ -1216,7 +1241,6 @@ package body Prj.Part is end; declare - Imported_Projects : Project_Node_Id := Empty_Node; From_Ext : Extension_Origin := None; begin @@ -1235,6 +1259,7 @@ package body Prj.Part is Post_Parse_Context_Clause (In_Tree => In_Tree, Context_Clause => First_With, + Limited_Withs => False, Imported_Projects => Imported_Projects, Project_Directory => Project_Directory, From_Extended => From_Ext, @@ -1372,7 +1397,7 @@ package body Prj.Part is end if; end; - Scan (In_Tree); -- scan past the extended project path + Scan (In_Tree); -- past the extended project path end if; end if; @@ -1553,6 +1578,36 @@ package body Prj.Part is end if; end if; + declare + From_Ext : Extension_Origin := None; + + begin + -- Extending_All is always propagated + + if From_Extended = Extending_All or else Extends_All then + From_Ext := Extending_All; + + -- Otherwise, From_Extended is set to Extending_Single if the + -- current project is an extending project. + + elsif Extended then + From_Ext := Extending_Simple; + end if; + + Post_Parse_Context_Clause + (In_Tree => In_Tree, + Context_Clause => First_With, + Limited_Withs => True, + Imported_Projects => Imported_Projects, + Project_Directory => Project_Directory, + From_Extended => From_Ext, + In_Limited => In_Limited, + Packages_To_Check => Packages_To_Check, + Depth => Depth + 1, + Current_Dir => Current_Dir); + Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects); + end; + -- Restore the scan state, in case we are not the main project Restore_Project_Scan_State (Project_Scan_State); diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 385e03536d5..e1a660946c7 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -1,5 +1,4 @@ ------------------------------------------------------------------------------ - -- -- -- GNAT COMPILER COMPONENTS -- -- -- @@ -7,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1104,64 +1103,59 @@ package body Prj.Proc is In_Tree : Project_Tree_Ref; With_Name : Name_Id) return Project_Id is - Data : constant Project_Data := - In_Tree.Projects.Table (Project); - List : Project_List := Data.Imported_Projects; - Result : Project_Id := No_Project; - Temp_Result : Project_Id := No_Project; + Data : constant Project_Data := In_Tree.Projects.Table (Project); + List : Project_List; + Result : Project_Id; + Temp_Result : Project_Id; begin -- First check if it is the name of an extended project - if Data.Extends /= No_Project - and then In_Tree.Projects.Table (Data.Extends).Name = - With_Name - then - return Data.Extends; + Result := Data.Extends; + while Result /= No_Project loop + if In_Tree.Projects.Table (Result).Name = With_Name then + return Result; + else + Result := In_Tree.Projects.Table (Result).Extends; + end if; + end loop; - else - -- Then check the name of each imported project + -- Then check the name of each imported project - while List /= Empty_Project_List loop - Result := In_Tree.Project_Lists.Table (List).Project; + Temp_Result := No_Project; + List := Data.Imported_Projects; + while List /= Empty_Project_List loop + Result := In_Tree.Project_Lists.Table (List).Project; - -- If the project is directly imported, then returns its ID + -- If the project is directly imported, then returns its ID - if - In_Tree.Projects.Table (Result).Name = With_Name - then - return Result; - end if; + if In_Tree.Projects.Table (Result).Name = With_Name then + return Result; + end if; - -- If a project extending the project is imported, then keep - -- this extending project as a possibility. It will be the - -- returned ID if the project is not imported directly. + -- If a project extending the project is imported, then keep this + -- extending project as a possibility. It will be the returned ID + -- if the project is not imported directly. - declare - Proj : Project_Id := - In_Tree.Projects.Table (Result).Extends; - begin - while Proj /= No_Project loop - if In_Tree.Projects.Table (Proj).Name = - With_Name - then - Temp_Result := Result; - exit; - end if; + declare + Proj : Project_Id := In_Tree.Projects.Table (Result).Extends; - Proj := In_Tree.Projects.Table (Proj).Extends; - end loop; - end; + begin + while Proj /= No_Project loop + if In_Tree.Projects.Table (Proj).Name = With_Name then + Temp_Result := Result; + exit; + end if; - List := In_Tree.Project_Lists.Table (List).Next; - end loop; + Proj := In_Tree.Projects.Table (Proj).Extends; + end loop; + end; - pragma Assert - (Temp_Result /= No_Project, - "project not found"); + List := In_Tree.Project_Lists.Table (List).Next; + end loop; - return Temp_Result; - end if; + pragma Assert (Temp_Result /= No_Project, "project not found"); + return Temp_Result; end Imported_Or_Extended_Project_From; ------------------ @@ -2530,6 +2524,7 @@ package body Prj.Proc is Processed_Projects.Set (Name, Project); Processed_Data.Name := Name; + In_Tree.Projects.Table (Project).Name := Name; Get_Name_String (Name); @@ -2588,61 +2583,74 @@ package body Prj.Proc is Prj.Attr.Attribute_First, Project_Level => True); + -- Process non limited withed projects + With_Clause := First_With_Clause_Of (From_Project_Node, From_Project_Node_Tree); while With_Clause /= Empty_Node loop declare New_Project : Project_Id; New_Data : Project_Data; + Proj_Node : Project_Node_Id; begin - Recursive_Process - (In_Tree => In_Tree, - Project => New_Project, - From_Project_Node => - Project_Node_Of (With_Clause, From_Project_Node_Tree), - From_Project_Node_Tree => From_Project_Node_Tree, - Extended_By => No_Project); - New_Data := - In_Tree.Projects.Table (New_Project); - - -- If we were the first project to import it, - -- set First_Referred_By to us. - - if New_Data.First_Referred_By = No_Project then - New_Data.First_Referred_By := Project; - In_Tree.Projects.Table (New_Project) := - New_Data; - end if; + Proj_Node := + Non_Limited_Project_Node_Of + (With_Clause, From_Project_Node_Tree); + + if Proj_Node /= Empty_Node then + Recursive_Process + (In_Tree => In_Tree, + Project => New_Project, + From_Project_Node => + Project_Node_Of + (With_Clause, From_Project_Node_Tree), + From_Project_Node_Tree => From_Project_Node_Tree, + Extended_By => No_Project); - -- Add this project to our list of imported projects + New_Data := + In_Tree.Projects.Table (New_Project); - Project_List_Table.Increment_Last - (In_Tree.Project_Lists); - In_Tree.Project_Lists.Table - (Project_List_Table.Last - (In_Tree.Project_Lists)) := - (Project => New_Project, Next => Empty_Project_List); + -- If we were the first project to import it, + -- set First_Referred_By to us. - -- Imported is the id of the last imported project. - -- If it is nil, then this imported project is our first. + if New_Data.First_Referred_By = No_Project then + New_Data.First_Referred_By := Project; + In_Tree.Projects.Table (New_Project) := + New_Data; + end if; - if Imported = Empty_Project_List then - Processed_Data.Imported_Projects := - Project_List_Table.Last - (In_Tree.Project_Lists); + -- Add this project to our list of imported projects + + Project_List_Table.Increment_Last + (In_Tree.Project_Lists); - else In_Tree.Project_Lists.Table - (Imported).Next := Project_List_Table.Last + (Project_List_Table.Last + (In_Tree.Project_Lists)) := + (Project => New_Project, Next => Empty_Project_List); + + -- Imported is the id of the last imported project. If it + -- is nil, then this imported project is our first. + + if Imported = Empty_Project_List then + Processed_Data.Imported_Projects := + Project_List_Table.Last + (In_Tree.Project_Lists); + + else + In_Tree.Project_Lists.Table + (Imported).Next := Project_List_Table.Last (In_Tree.Project_Lists); - end if; + end if; - Imported := Project_List_Table.Last - (In_Tree.Project_Lists); + Imported := Project_List_Table.Last + (In_Tree.Project_Lists); + end if; With_Clause := - Next_With_Clause_Of (With_Clause, From_Project_Node_Tree); + Next_With_Clause_Of + (With_Clause, From_Project_Node_Tree); end; end loop; @@ -2676,9 +2684,9 @@ package body Prj.Proc is -- or renamed. Also inherit the languages, if attribute Languages -- is not explicitely defined. - if Processed_Data.Extends /= No_Project then - Processed_Data := In_Tree.Projects.Table (Project); + Processed_Data := In_Tree.Projects.Table (Project); + if Processed_Data.Extends /= No_Project then declare Extended_Pkg : Package_Id; Current_Pkg : Package_Id; @@ -2778,9 +2786,78 @@ package body Prj.Proc is end if; end if; end; - - In_Tree.Projects.Table (Project) := Processed_Data; end if; + + -- Process limited withed projects + + With_Clause := + First_With_Clause_Of + (From_Project_Node, From_Project_Node_Tree); + while With_Clause /= Empty_Node loop + declare + New_Project : Project_Id; + New_Data : Project_Data; + Proj_Node : Project_Node_Id; + + begin + Proj_Node := + Non_Limited_Project_Node_Of + (With_Clause, From_Project_Node_Tree); + + if Proj_Node = Empty_Node then + Recursive_Process + (In_Tree => In_Tree, + Project => New_Project, + From_Project_Node => + Project_Node_Of + (With_Clause, From_Project_Node_Tree), + From_Project_Node_Tree => From_Project_Node_Tree, + Extended_By => No_Project); + + New_Data := + In_Tree.Projects.Table (New_Project); + + -- If we were the first project to import it, set + -- First_Referred_By to us. + + if New_Data.First_Referred_By = No_Project then + New_Data.First_Referred_By := Project; + In_Tree.Projects.Table (New_Project) := + New_Data; + end if; + + -- Add this project to our list of imported projects + + Project_List_Table.Increment_Last + (In_Tree.Project_Lists); + + In_Tree.Project_Lists.Table + (Project_List_Table.Last + (In_Tree.Project_Lists)) := + (Project => New_Project, Next => Empty_Project_List); + + -- Imported is the id of the last imported project. If + -- it is nil, then this imported project is our first. + + if Imported = Empty_Project_List then + In_Tree.Projects.Table (Project).Imported_Projects := + Project_List_Table.Last + (In_Tree.Project_Lists); + else + In_Tree.Project_Lists.Table + (Imported).Next := Project_List_Table.Last + (In_Tree.Project_Lists); + end if; + + Imported := Project_List_Table.Last + (In_Tree.Project_Lists); + end if; + + With_Clause := + Next_With_Clause_Of + (With_Clause, From_Project_Node_Tree); + end; + end loop; end; end if; end Recursive_Process; diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb index ee206058557..db32e4a0a07 100644 --- a/gcc/ada/prj-tree.adb +++ b/gcc/ada/prj-tree.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1047,18 +1047,18 @@ package body Prj.Tree is With_Clause := Next_With_Clause_Of (With_Clause, In_Tree); end loop; - -- If it is not an imported project, it might be the imported project + -- If it is not an imported project, it might be an extended project if With_Clause = Empty_Node then - Result := - Extended_Project_Of - (Project_Declaration_Of (Project, In_Tree), In_Tree); - - if Result /= Empty_Node - and then Name_Of (Result, In_Tree) /= With_Name - then - Result := Empty_Node; - end if; + Result := Project; + loop + Result := + Extended_Project_Of + (Project_Declaration_Of (Result, In_Tree), In_Tree); + + exit when Result = Empty_Node + or else Name_Of (Result, In_Tree) = With_Name; + end loop; end if; return Result; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index b242c2cead8..5cedfdc0ec1 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -68,9 +68,9 @@ package Prj is -- Ada. Calling Set_Mode will reset this variable, default is for Ada_Only. Must_Check_Configuration : Boolean := False; - -- Whether the contents of the configuration file must be checked. This is - -- in general only needed by gprbuild itself, since other applications can - -- ignore such errors when they don't need to build directly. Calling + -- True when the contents of the configuration file must be checked. This + -- is in general only needed by gprbuild itself, since other applications + -- can ignore such errors when they don't need to build directly. Calling -- Set_Mode will reset this variable, default is for Ada_Only. function In_Configuration return Boolean; @@ -1066,18 +1066,18 @@ package Prj is -- for libraries. Executable_Suffix : Name_Id := No_Name; - -- The suffix of executables, when specified in the configuration or - -- in package Builder of the main project. When this is not + -- The suffix of executables, when specified in the configuration + -- or in package Builder of the main project. When this is not -- specified, the executable suffix is the default for the platform. -- Linking Linker : Path_Name_Type := No_Path; - -- Path name of the linker driver; specified in the configuration + -- Path name of the linker driver. Specified in the configuration -- or in the package Builder of the main project. Minimum_Linker_Options : Name_List_Index := No_Name_List; - -- The minimum options for the linker driver; specified in the + -- The minimum options for the linker driver. Specified in the -- configuration. Linker_Executable_Option : Name_List_Index := No_Name_List; @@ -1091,14 +1091,13 @@ package Prj is -- "-L". Linker_Lib_Name_Option : Name_Id := No_Name; - -- The option to specify the name of a library for linking. - -- Specified in the configuration. When not specified, defaults to - -- "-l". + -- The option to specify the name of a library for linking. Specified + -- in the configuration. When not specified, defaults to "-l". -- Libraries Library_Builder : Path_Name_Type := No_Path; - -- The executable to build library. Specified in the configuration. + -- The executable to build library (specified in the configuration) Lib_Support : Library_Support := None; -- The level of library support. Specified in the configuration. @@ -1134,19 +1133,19 @@ package Prj is -- default to ".so". Shared_Lib_Min_Options : Name_List_Index := No_Name_List; - -- + -- Comment ??? Lib_Version_Options : Name_List_Index := No_Name_List; - -- + -- Comment ??? Symbolic_Link_Supported : Boolean := False; - -- + -- Comment ??? Lib_Maj_Min_Id_Supported : Boolean := False; - -- + -- Comment ??? Auto_Init_Supported : Boolean := False; - -- + -- Comment ??? end record; Default_Project_Config : constant Project_Configuration := @@ -1287,10 +1286,10 @@ package Prj is -- Symbol file name, reference symbol file name, symbol policy Ada_Sources : String_List_Id := Nil_String; - -- The list of all the Ada source file names (gnatmake only). + -- The list of all the Ada source file names (gnatmake only) Sources : String_List_Id := Nil_String; - -- Identical to Ada_Sources. For upward compatibility of GPS. + -- Identical to Ada_Sources (for upward compatibility with GPS) First_Source : Source_Id := No_Source; Last_Source : Source_Id := No_Source; @@ -1465,17 +1464,20 @@ package Prj is (Extending : Project_Id; Extended : Project_Id; In_Tree : Project_Tree_Ref) return Boolean; + -- ??? needs comment function Is_A_Language (Tree : Project_Tree_Ref; Data : Project_Data; Language_Name : Name_Id) return Boolean; - -- Whether Language_Name is one of the languages used for the project. - -- Language_Name must be lower cased. + -- Return True when Language_Name (which must be lower case) is one of the + -- languages used for the project. function There_Are_Ada_Sources (In_Tree : Project_Tree_Ref; Project : Project_Id) return Boolean; + -- ??? needs comment + -- ??? Name sounds strange, suggested replacement: Ada_Sources_Present Project_Error : exception; -- Raised by some subprograms in Prj.Attr @@ -1488,8 +1490,7 @@ package Prj is Table_Increment => 100); -- The set of all project files - type Spec_Or_Body is - (Specification, Body_Part); + type Spec_Or_Body is (Specification, Body_Part); type File_Name_Data is record Name : File_Name_Type := No_File; @@ -1597,8 +1598,8 @@ package Prj is -- Use to customize error reporting in Prj.Proc and Prj.Nmsc procedure Expect (The_Token : Token_Type; Token_Image : String); - -- Check that the current token is The_Token. If it is not, then - -- output an error message. + -- Check that the current token is The_Token. If it is not, then output + -- an error message. procedure Initialize (Tree : Project_Tree_Ref); -- This procedure must be called before using any services from the Prj diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 85134080835..068d601c2c6 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -26,6 +26,7 @@ with Atree; use Atree; with Casing; use Casing; with Errout; use Errout; +with Debug; use Debug; with Fname; use Fname; with Fname.UF; use Fname.UF; with Lib; use Lib; @@ -430,6 +431,18 @@ package body Restrict is Restrictions.Set (No_Exception_Propagation)); end No_Exception_Handlers_Set; + ------------------------------------- + -- No_Exception_Propagation_Active -- + ------------------------------------- + + function No_Exception_Propagation_Active return Boolean is + begin + return (No_Run_Time_Mode + or else Configurable_Run_Time_Mode + or else Debug_Flag_Dot_G) + and then Restriction_Active (No_Exception_Propagation); + end No_Exception_Propagation_Active; + ---------------------------------- -- Process_Restriction_Synonyms -- ---------------------------------- diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads index e82449e5933..0cd4dbf28bf 100644 --- a/gcc/ada/restrict.ads +++ b/gcc/ada/restrict.ads @@ -249,6 +249,10 @@ package Restrict is -- set. In the latter case, the source may contain handlers but they either -- get converted using the local goto transformation or deleted. + function No_Exception_Propagation_Active return Boolean; + -- Test to see if current restrictions settings specify that no + -- exception propagation is activated. + function Process_Restriction_Synonyms (N : Node_Id) return Name_Id; -- Id is a node whose Chars field contains the name of a restriction. -- If it is one of synonyms that we allow for historical purposes (for diff --git a/gcc/ada/s-asthan.adb b/gcc/ada/s-asthan.adb index 00df7f45b16..bb3ac693df4 100644 --- a/gcc/ada/s-asthan.adb +++ b/gcc/ada/s-asthan.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,12 +33,8 @@ -- This is the dummy version used on non-VMS systems -with Ada.Exceptions; - package body System.AST_Handling is - pragma Warnings (Off); -- kill warnings on unreferenced formals - ------------------------ -- Create_AST_Handler -- ------------------------ @@ -48,10 +44,7 @@ package body System.AST_Handling is Entryno : Natural) return System.Aux_DEC.AST_Handler is begin - Ada.Exceptions.Raise_Exception - (E => Program_Error'Identity, - Message => "AST is implemented only on VMS systems"); - + raise Program_Error with "AST is implemented only on VMS systems"; return System.Aux_DEC.No_AST_Handler; end Create_AST_Handler; @@ -61,12 +54,7 @@ package body System.AST_Handling is Total_Number : out Natural) is begin - Ada.Exceptions.Raise_Exception - (E => Program_Error'Identity, - Message => "AST is implemented only on VMS systems"); - - Actual_Number := 0; - Total_Number := 0; + raise Program_Error with "AST is implemented only on VMS systems"; end Expand_AST_Packet_Pool; end System.AST_Handling; diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads index 30bca62c455..4ab0e7d606d 100644 --- a/gcc/ada/s-crtl.ads +++ b/gcc/ada/s-crtl.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2003-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -148,9 +148,6 @@ package System.CRTL is function popen (command, mode : System.Address) return System.Address; pragma Import (C, popen, "popen"); - function read (fd : int; buffer : chars; nbytes : int) return int; - pragma Import (C, read, "read"); - function realloc (Ptr : System.Address; Size : size_t) return System.Address; pragma Import (C, realloc, "realloc"); @@ -181,6 +178,15 @@ package System.CRTL is function unlink (filename : chars) return int; pragma Import (C, unlink, "unlink"); + function open (filename : chars; oflag : int) return int; + pragma Import (C, open, "open"); + + function close (fd : int) return int; + pragma Import (C, close, "close"); + + function read (fd : int; buffer : chars; nbytes : int) return int; + pragma Import (C, read, "read"); + function write (fd : int; buffer : chars; nbytes : int) return int; pragma Import (C, write, "write"); diff --git a/gcc/ada/s-gloloc.adb b/gcc/ada/s-gloloc.adb index 197b4a9abfc..2ab69089426 100644 --- a/gcc/ada/s-gloloc.adb +++ b/gcc/ada/s-gloloc.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,7 +32,6 @@ ------------------------------------------------------------------------------ with System.Soft_Links; --- used for Lock_Task, Unlock_Task package body System.Global_Locks is diff --git a/gcc/ada/s-inmaop-posix.adb b/gcc/ada/s-inmaop-posix.adb index 2251c23d3c5..3a10e73bc51 100644 --- a/gcc/ada/s-inmaop-posix.adb +++ b/gcc/ada/s-inmaop-posix.adb @@ -2,13 +2,12 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T . -- --- O P E R A T I O N S -- +-- SYSTEM.INTERRUPT_MANAGEMENT.OPERATIONS -- -- -- -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,20 +32,14 @@ -- -- ------------------------------------------------------------------------------ --- This is a POSIX-like version of this package. --- Note: this file can only be used for POSIX compliant systems. +-- This is a POSIX-like version of this package + +-- Note: this file can only be used for POSIX compliant systems with Interfaces.C; --- used for int --- size_t --- unsigned with System.OS_Interface; --- used for various type, constant, and operations - with System.Storage_Elements; --- used for To_Address --- Integer_Address package body System.Interrupt_Management.Operations is diff --git a/gcc/ada/s-inmaop-vms.adb b/gcc/ada/s-inmaop-vms.adb index 3c04bb0e074..34eaf09547d 100644 --- a/gcc/ada/s-inmaop-vms.adb +++ b/gcc/ada/s-inmaop-vms.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,19 +34,11 @@ -- This is a OpenVMS/Alpha version of this package with System.OS_Interface; --- used for various type, constant, and operations - with System.Aux_DEC; --- used for Short_Address - with System.Parameters; - with System.Tasking; - with System.Tasking.Initialization; - with System.Task_Primitives.Operations; - with System.Task_Primitives.Operations.DEC; with Ada.Unchecked_Conversion; diff --git a/gcc/ada/s-interr-dummy.adb b/gcc/ada/s-interr-dummy.adb index c0876b8ee58..075c8b5755c 100644 --- a/gcc/ada/s-interr-dummy.adb +++ b/gcc/ada/s-interr-dummy.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1995-2007, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,8 +34,6 @@ -- This version is for systems that do not support interrupts (or signals) -with Ada.Exceptions; - package body System.Interrupts is pragma Warnings (Off); -- kill warnings on unreferenced formals @@ -293,9 +291,7 @@ package body System.Interrupts is procedure Unimplemented is begin - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "interrupts/signals not implemented"); - raise Program_Error; + raise Program_Error with "interrupts/signals not implemented"; end Unimplemented; end System.Interrupts; diff --git a/gcc/ada/s-interr-sigaction.adb b/gcc/ada/s-interr-sigaction.adb index 38428e5d7d6..a63b35aaaa3 100644 --- a/gcc/ada/s-interr-sigaction.adb +++ b/gcc/ada/s-interr-sigaction.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,47 +34,22 @@ -- This is the IRIX & NT version of this package with Ada.Task_Identification; --- used for Task_Id +with Ada.Unchecked_Conversion; -with Ada.Exceptions; --- used for Raise_Exception +with Interfaces.C; with System.Storage_Elements; --- used for To_Address --- To_Integer - with System.Task_Primitives.Operations; --- used for Self --- Sleep --- Wakeup --- Write_Lock --- Unlock - with System.Tasking.Utilities; --- used for Make_Independent - with System.Tasking.Rendezvous; --- used for Call_Simple - with System.Tasking.Initialization; --- used for Defer_Abort --- Undefer_Abort - with System.Interrupt_Management; - with System.Parameters; --- used for Single_Lock - -with Interfaces.C; --- used for int - -with Ada.Unchecked_Conversion; package body System.Interrupts is use Parameters; use Tasking; - use Ada.Exceptions; use System.OS_Interface; use Interfaces.C; @@ -183,8 +158,8 @@ package body System.Interrupts is function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Descriptors (Interrupt).T /= Null_Task; @@ -197,11 +172,11 @@ package body System.Interrupts is function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; + else + return Descriptors (Interrupt).Kind /= Unknown; end if; - - return Descriptors (Interrupt).Kind /= Unknown; end Is_Handler_Attached; ---------------- @@ -370,9 +345,9 @@ package body System.Interrupts is or else not Is_Registered (New_Handler)) then - Raise_Exception (Program_Error'Identity, + raise Program_Error with "Trying to overwrite a static Interrupt Handler with a " & - "dynamic Handler"); + "dynamic Handler"; end if; if Handlers (Interrupt) = null then @@ -420,12 +395,12 @@ package body System.Interrupts is -- In case we have an Interrupt Entry already installed. -- raise a program error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt is already installed"); - end if; + raise Program_Error with "An interrupt is already installed"; - Old_Handler := Current_Handler (Interrupt); - Attach_Handler (New_Handler, Interrupt, Static); + else + Old_Handler := Current_Handler (Interrupt); + Attach_Handler (New_Handler, Interrupt, Static); + end if; end Exchange_Handler; -------------------- @@ -442,13 +417,12 @@ package body System.Interrupts is end if; if Descriptors (Interrupt).Kind = Task_Entry then - Raise_Exception (Program_Error'Identity, - "Trying to detach an Interrupt Entry"); + raise Program_Error with "Trying to detach an Interrupt Entry"; end if; if not Static and then Descriptors (Interrupt).Static then - Raise_Exception (Program_Error'Identity, - "Trying to detach a static Interrupt Handler"); + raise Program_Error with + "Trying to detach a static Interrupt Handler"; end if; Descriptors (Interrupt) := @@ -548,8 +522,8 @@ package body System.Interrupts is end if; if Descriptors (Interrupt).Kind /= Unknown then - Raise_Exception (Program_Error'Identity, - "A binding for this interrupt is already present"); + raise Program_Error with + "A binding for this interrupt is already present"; end if; if Handlers (Interrupt) = null then diff --git a/gcc/ada/s-interr-vms.adb b/gcc/ada/s-interr-vms.adb index 29c0e7f9b65..3a7124025c2 100644 --- a/gcc/ada/s-interr-vms.adb +++ b/gcc/ada/s-interr-vms.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -49,77 +49,29 @@ -- rendezvous. with Ada.Task_Identification; --- used for Task_Id type - -with Ada.Exceptions; --- used for Raise_Exception +with Ada.Unchecked_Conversion; with System.Task_Primitives; --- used for RTS_Lock --- Self - with System.Interrupt_Management; --- used for Reserve --- Interrupt_ID --- Interrupt_Mask --- Abort_Task_Interrupt with System.Interrupt_Management.Operations; --- used for Thread_Block_Interrupt --- Thread_Unblock_Interrupt --- Install_Default_Action --- Install_Ignore_Action --- Copy_Interrupt_Mask --- Set_Interrupt_Mask --- Empty_Interrupt_Mask --- Fill_Interrupt_Mask --- Add_To_Interrupt_Mask --- Delete_From_Interrupt_Mask --- Interrupt_Wait --- Interrupt_Self_Process --- Get_Interrupt_Mask --- Set_Interrupt_Mask --- IS_Member --- Environment_Mask pragma Elaborate_All (System.Interrupt_Management.Operations); with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Abort --- Wakeup_Task --- Sleep --- Initialize_Lock - with System.Task_Primitives.Interrupt_Operations; --- used for Set_Interrupt_ID - with System.Storage_Elements; --- used for To_Address --- To_Integer --- Integer_Address - with System.Tasking.Utilities; --- used for Make_Independent with System.Tasking.Rendezvous; --- used for Call_Simple pragma Elaborate_All (System.Tasking.Rendezvous); with System.Tasking.Initialization; --- used for Defer_Abort --- Undefer_Abort - with System.Parameters; --- used for Single_Lock - -with Ada.Unchecked_Conversion; package body System.Interrupts is use Tasking; use System.Parameters; - use Ada.Exceptions; package POP renames System.Task_Primitives.Operations; package PIO renames System.Task_Primitives.Interrupt_Operations; @@ -345,8 +297,8 @@ package body System.Interrupts is function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return User_Entry (Interrupt).T /= Null_Task; @@ -359,8 +311,8 @@ package body System.Interrupts is function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return User_Handler (Interrupt).H /= null; @@ -373,8 +325,8 @@ package body System.Interrupts is function Is_Blocked (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Blocked (Interrupt); @@ -387,8 +339,8 @@ package body System.Interrupts is function Is_Ignored (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Ignored (Interrupt); @@ -403,8 +355,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; -- ??? Since Parameterless_Handler is not Atomic, the current @@ -432,8 +384,8 @@ package body System.Interrupts is Static : Boolean := False) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Attach_Handler (New_Handler, Interrupt, Static); @@ -460,8 +412,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Exchange_Handler @@ -486,8 +438,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Detach_Handler (Interrupt, Static); @@ -500,8 +452,8 @@ package body System.Interrupts is function Reference (Interrupt : Interrupt_ID) return System.Address is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Storage_Elements.To_Address @@ -526,8 +478,8 @@ package body System.Interrupts is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Bind_Interrupt_To_Entry (T, E, Interrupt); @@ -550,8 +502,8 @@ package body System.Interrupts is procedure Block_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Block_Interrupt (Interrupt); @@ -564,8 +516,8 @@ package body System.Interrupts is procedure Unblock_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Unblock_Interrupt (Interrupt); @@ -579,8 +531,8 @@ package body System.Interrupts is (Interrupt : Interrupt_ID) return System.Tasking.Task_Id is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Last_Unblocker (Interrupt); @@ -593,8 +545,8 @@ package body System.Interrupts is procedure Ignore_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Ignore_Interrupt (Interrupt); @@ -607,8 +559,8 @@ package body System.Interrupts is procedure Unignore_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Unignore_Interrupt (Interrupt); @@ -648,21 +600,21 @@ package body System.Interrupts is is begin if User_Entry (Interrupt).T /= Null_Task then + -- In case we have an Interrupt Entry already installed. -- raise a program error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt is already installed"); + raise Program_Error with "An interrupt is already installed"; end if; - -- Note : A null handler with Static = True will - -- pass the following check. That is the case when we want to - -- Detach a handler regardless of the Static status - -- of the current_Handler. - -- We don't check anything if Restoration is True, since we - -- may be detaching a static handler to restore a dynamic one. + -- Note: A null handler with Static=True will pass the following + -- check. That is the case when we want to Detach a handler + -- regardless of the Static status of the current_Handler. We don't + -- check anything if Restoration is True, since we may be detaching + -- a static handler to restore a dynamic one. if not Restoration and then not Static + -- Tries to overwrite a static Interrupt Handler with a -- dynamic Handler @@ -673,9 +625,9 @@ package body System.Interrupts is or else not Is_Registered (New_Handler)) then - Raise_Exception (Program_Error'Identity, + raise Program_Error with "Trying to overwrite a static Interrupt Handler with a " & - "dynamic Handler"); + "dynamic Handler"; end if; -- The interrupt should no longer be ingnored if it was ever ignored @@ -722,11 +674,12 @@ package body System.Interrupts is is begin if User_Entry (Interrupt).T /= Null_Task then + -- In case we have an Interrupt Entry installed. -- raise a program error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt entry is already installed"); + raise Program_Error with + "An interrupt entry is already installed"; end if; -- Note : Static = True will pass the following check. That is the @@ -737,8 +690,8 @@ package body System.Interrupts is -- Tries to detach a static Interrupt Handler. -- raise a program error. - Raise_Exception (Program_Error'Identity, - "Trying to detach a static Interrupt Handler"); + raise Program_Error with + "Trying to detach a static Interrupt Handler"; end if; -- The interrupt should no longer be ignored if @@ -849,8 +802,8 @@ package body System.Interrupts is if User_Handler (Interrupt).H /= null or else User_Entry (Interrupt).T /= Null_Task then - Raise_Exception (Program_Error'Identity, - "A binding for this interrupt is already present"); + raise Program_Error with + "A binding for this interrupt is already present"; end if; -- The interrupt should no longer be ingnored if diff --git a/gcc/ada/s-interr-vxworks.adb b/gcc/ada/s-interr-vxworks.adb index 740b5076b6c..ec14f11c899 100644 --- a/gcc/ada/s-interr-vxworks.adb +++ b/gcc/ada/s-interr-vxworks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -56,54 +56,31 @@ -- any time. -- Within this package, the lock L is used to protect the various status --- tables. If there is a Server_Task associated with a signal or interrupt, --- we use the per-task lock of the Server_Task instead so that we protect the --- status between Interrupt_Manager and Server_Task. Protection among --- service requests are ensured via user calls to the Interrupt_Manager --- entries. +-- tables. If there is a Server_Task associated with a signal or interrupt, we +-- use the per-task lock of the Server_Task instead so that we protect the +-- status between Interrupt_Manager and Server_Task. Protection among service +-- requests are ensured via user calls to the Interrupt_Manager entries. -- This is the VxWorks version of this package, supporting vectored hardware -- interrupts. with Ada.Unchecked_Conversion; - -with System.OS_Interface; use System.OS_Interface; - -with Interfaces.VxWorks; - with Ada.Task_Identification; --- used for Task_Id type -with Ada.Exceptions; --- used for Raise_Exception +with Interfaces.VxWorks; +with System.OS_Interface; use System.OS_Interface; with System.Interrupt_Management; --- used for Reserve - with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Abort --- Wakeup_Task --- Sleep --- Initialize_Lock - with System.Storage_Elements; --- used for To_Address --- To_Integer --- Integer_Address - with System.Tasking.Utilities; --- used for Make_Independent with System.Tasking.Rendezvous; --- used for Call_Simple pragma Elaborate_All (System.Tasking.Rendezvous); package body System.Interrupts is use Tasking; - use Ada.Exceptions; package POP renames System.Task_Primitives.Operations; @@ -310,9 +287,8 @@ package body System.Interrupts is procedure Check_Reserved_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception - (Program_Error'Identity, - "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; else return; end if; @@ -744,9 +720,7 @@ package body System.Interrupts is procedure Unimplemented (Feature : String) is begin - Raise_Exception - (Program_Error'Identity, - Feature & " not implemented on VxWorks"); + raise Program_Error with Feature & " not implemented on VxWorks"; end Unimplemented; ----------------------- @@ -823,8 +797,8 @@ package body System.Interrupts is -- If an interrupt entry is installed raise -- Program_Error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt entry is already installed"); + raise Program_Error with + "An interrupt entry is already installed"; end if; -- Note : Static = True will pass the following check. This is the @@ -836,8 +810,8 @@ package body System.Interrupts is -- Trying to detach a static Interrupt Handler. raise -- Program_Error. - Raise_Exception (Program_Error'Identity, - "Trying to detach a static Interrupt Handler"); + raise Program_Error with + "Trying to detach a static Interrupt Handler"; end if; Old_Handler := User_Handler (Interrupt).H; @@ -869,9 +843,7 @@ package body System.Interrupts is -- If an interrupt entry is already installed, raise -- Program_Error. (propagate it to the caller). - Raise_Exception - (Program_Error'Identity, - "An interrupt is already installed"); + raise Program_Error with "An interrupt is already installed"; end if; -- Note : A null handler with Static = True will @@ -892,10 +864,9 @@ package body System.Interrupts is or else not Is_Registered (New_Handler)) then - Raise_Exception - (Program_Error'Identity, + raise Program_Error with "Trying to overwrite a static Interrupt Handler with a " & - "dynamic Handler"); + "dynamic Handler"; end if; -- Save the old handler @@ -1003,9 +974,8 @@ package body System.Interrupts is if User_Handler (Interrupt).H /= null or else User_Entry (Interrupt).T /= Null_Task then - Raise_Exception - (Program_Error'Identity, - "A binding for this interrupt is already present"); + raise Program_Error with + "A binding for this interrupt is already present"; end if; User_Entry (Interrupt) := Entry_Assoc'(T => T, E => E); diff --git a/gcc/ada/s-interr.adb b/gcc/ada/s-interr.adb index 6f112826c4a..7b4175eab59 100644 --- a/gcc/ada/s-interr.adb +++ b/gcc/ada/s-interr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -55,70 +55,23 @@ -- one Server_Task per interrupt. with Ada.Task_Identification; --- used for Task_Id type - -with Ada.Exceptions; --- used for Raise_Exception with System.Task_Primitives; --- used for RTS_Lock --- Self - with System.Interrupt_Management; --- used for Reserve --- Interrupt_ID --- Interrupt_Mask --- Abort_Task_Interrupt with System.Interrupt_Management.Operations; --- used for Thread_Block_Interrupt --- Thread_Unblock_Interrupt --- Install_Default_Action --- Install_Ignore_Action --- Copy_Interrupt_Mask --- Set_Interrupt_Mask --- Empty_Interrupt_Mask --- Fill_Interrupt_Mask --- Add_To_Interrupt_Mask --- Delete_From_Interrupt_Mask --- Interrupt_Wait --- Interrupt_Self_Process --- Get_Interrupt_Mask --- Set_Interrupt_Mask --- IS_Member --- Environment_Mask --- All_Tasks_Mask pragma Elaborate_All (System.Interrupt_Management.Operations); with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Abort --- Wakeup_Task --- Sleep --- Initialize_Lock - with System.Task_Primitives.Interrupt_Operations; --- used for Set_Interrupt_ID - with System.Storage_Elements; --- used for To_Address --- To_Integer --- Integer_Address - with System.Tasking.Utilities; --- used for Make_Independent with System.Tasking.Rendezvous; --- used for Call_Simple pragma Elaborate_All (System.Tasking.Rendezvous); with System.Tasking.Initialization; --- used for Defer_Abort --- Undefer_Abort - with System.Parameters; --- used for Single_Lock with Ada.Unchecked_Conversion; @@ -126,7 +79,6 @@ package body System.Interrupts is use Parameters; use Tasking; - use Ada.Exceptions; package POP renames System.Task_Primitives.Operations; package PIO renames System.Task_Primitives.Interrupt_Operations; @@ -285,8 +237,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Attach_Handler (New_Handler, Interrupt, Static); @@ -310,8 +262,8 @@ package body System.Interrupts is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Bind_Interrupt_To_Entry (T, E, Interrupt); @@ -324,8 +276,8 @@ package body System.Interrupts is procedure Block_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Block_Interrupt (Interrupt); @@ -340,8 +292,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; -- ??? Since Parameterless_Handler is not Atomic, the current @@ -368,8 +320,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Detach_Handler (Interrupt, Static); @@ -404,8 +356,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Exchange_Handler @@ -464,8 +416,8 @@ package body System.Interrupts is procedure Ignore_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Ignore_Interrupt (Interrupt); @@ -506,8 +458,8 @@ package body System.Interrupts is function Is_Blocked (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Blocked (Interrupt); @@ -520,8 +472,8 @@ package body System.Interrupts is function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return User_Entry (Interrupt).T /= Null_Task; @@ -534,8 +486,8 @@ package body System.Interrupts is function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return User_Handler (Interrupt).H /= null; @@ -548,8 +500,8 @@ package body System.Interrupts is function Is_Ignored (Interrupt : Interrupt_ID) return Boolean is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Ignored (Interrupt); @@ -608,8 +560,8 @@ package body System.Interrupts is function Reference (Interrupt : Interrupt_ID) return System.Address is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Storage_Elements.To_Address @@ -656,8 +608,8 @@ package body System.Interrupts is procedure Unblock_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Unblock_Interrupt (Interrupt); @@ -672,8 +624,8 @@ package body System.Interrupts is is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; return Last_Unblocker (Interrupt); @@ -686,8 +638,8 @@ package body System.Interrupts is procedure Unignore_Interrupt (Interrupt : Interrupt_ID) is begin if Is_Reserved (Interrupt) then - Raise_Exception (Program_Error'Identity, "Interrupt" & - Interrupt_ID'Image (Interrupt) & " is reserved"); + raise Program_Error with + "Interrupt" & Interrupt_ID'Image (Interrupt) & " is reserved"; end if; Interrupt_Manager.Unignore_Interrupt (Interrupt); @@ -825,8 +777,8 @@ package body System.Interrupts is -- In case we have an Interrupt Entry installed. -- raise a program error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt entry is already installed"); + raise Program_Error with + "An interrupt entry is already installed"; end if; -- Note : Static = True will pass the following check. That is the @@ -838,8 +790,8 @@ package body System.Interrupts is -- Tries to detach a static Interrupt Handler. -- raise a program error. - Raise_Exception (Program_Error'Identity, - "Trying to detach a static Interrupt Handler"); + raise Program_Error with + "Trying to detach a static Interrupt Handler"; end if; -- The interrupt should no longer be ignored if @@ -876,8 +828,8 @@ package body System.Interrupts is -- In case we have an Interrupt Entry already installed. -- raise a program error. (propagate it to the caller). - Raise_Exception (Program_Error'Identity, - "An interrupt is already installed"); + raise Program_Error with + "An interrupt is already installed"; end if; -- Note : A null handler with Static = True will pass the @@ -899,9 +851,9 @@ package body System.Interrupts is or else not Is_Registered (New_Handler)) then - Raise_Exception (Program_Error'Identity, + raise Program_Error with "Trying to overwrite a static Interrupt Handler with a " & - "dynamic Handler"); + "dynamic Handler"; end if; -- The interrupt should no longer be ingnored if @@ -1062,8 +1014,8 @@ package body System.Interrupts is if User_Handler (Interrupt).H /= null or else User_Entry (Interrupt).T /= Null_Task then - Raise_Exception (Program_Error'Identity, - "A binding for this interrupt is already present"); + raise Program_Error with + "A binding for this interrupt is already present"; end if; -- The interrupt should no longer be ingnored if diff --git a/gcc/ada/s-interr.ads b/gcc/ada/s-interr.ads index a01b4c0b4fd..1eecfdb9af9 100644 --- a/gcc/ada/s-interr.ads +++ b/gcc/ada/s-interr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,24 +35,19 @@ -- Any changes to this interface may require corresponding compiler changes. -- This package encapsulates the implementation of interrupt or signal --- handlers. It is logically an extension of the body of Ada.Interrupts. --- It is made a child of System to allow visibility of various --- runtime system internal data and operations. +-- handlers. It is logically an extension of the body of Ada.Interrupts. It +-- is made a child of System to allow visibility of various runtime system +-- internal data and operations. -- See System.Interrupt_Management for core interrupt/signal interfaces --- These two packages are separated in order to allow --- System.Interrupt_Management to be used without requiring the whole --- tasking implementation to be linked and elaborated. +-- These two packages are separated to allow System.Interrupt_Management to be +-- used without requiring the whole tasking implementation to be linked and +-- elaborated. with System.Tasking; --- used for Task_Id - with System.Tasking.Protected_Objects.Entries; --- used for Protection_Entries - with System.OS_Interface; --- used for Max_Interrupt package System.Interrupts is @@ -73,11 +68,9 @@ package System.Interrupts is type Interrupt_ID is range 0 .. System.OS_Interface.Max_Interrupt; - -- The following renaming is introduced so that the type is accessible - -- through rtsfind, otherwise the name clashes with its homonym in - -- ada.interrupts. - subtype System_Interrupt_Id is Interrupt_ID; + -- This synonym is introduced so that the type is accessible through + -- rtsfind, otherwise the name clashes with its homonym in Ada.Interrupts. type Parameterless_Handler is access protected procedure; @@ -97,10 +90,10 @@ package System.Interrupts is function Current_Handler (Interrupt : Interrupt_ID) return Parameterless_Handler; - -- Calling the following procedures with New_Handler = null - -- and Static = true means that we want to modify the current handler - -- regardless of the previous handler's binding status. - -- (i.e. we do not care whether it is a dynamic or static handler) + -- Calling the following procedures with New_Handler = null and Static = + -- true means that we want to modify the current handler regardless of the + -- previous handler's binding status. (i.e. we do not care whether it is a + -- dynamic or static handler) procedure Attach_Handler (New_Handler : Parameterless_Handler; @@ -150,8 +143,8 @@ package System.Interrupts is function Unblocked_By (Interrupt : Interrupt_ID) return System.Tasking.Task_Id; -- It returns the ID of the last Task which Unblocked this Interrupt. - -- It returns Null_Task if no tasks have ever requested the - -- Unblocking operation or the Interrupt is currently Blocked. + -- It returns Null_Task if no tasks have ever requested the Unblocking + -- operation or the Interrupt is currently Blocked. function Is_Blocked (Interrupt : Interrupt_ID) return Boolean; -- Comment needed ??? @@ -169,9 +162,9 @@ package System.Interrupts is -- other low-level interface that changes the signal action or signal mask -- needs a careful thought. - -- One may acheive the effect of system calls first making RTS blocked - -- (by calling Block_Interrupt) for the signal under consideration. - -- This will make all the tasks in RTS blocked for the Interrupt. + -- One may acheive the effect of system calls first making RTS blocked (by + -- calling Block_Interrupt) for the signal under consideration. This will + -- make all the tasks in RTS blocked for the Interrupt. ---------------------- -- Protection Types -- diff --git a/gcc/ada/s-intman-vms.ads b/gcc/ada/s-intman-vms.ads index ff0c8240193..ac06d118d54 100644 --- a/gcc/ada/s-intman-vms.ads +++ b/gcc/ada/s-intman-vms.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -48,8 +48,6 @@ -- implemented as visible arrays rather than functions.) with System.OS_Interface; --- used for Signal --- sigset_t package System.Interrupt_Management is pragma Preelaborate; diff --git a/gcc/ada/s-intman-vxworks.ads b/gcc/ada/s-intman-vxworks.ads index ec332684521..538c4e5a0e1 100644 --- a/gcc/ada/s-intman-vxworks.ads +++ b/gcc/ada/s-intman-vxworks.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -48,10 +48,8 @@ -- sets are implemeneted using visible arrays rather than functions. with System.OS_Interface; --- used for sigset_t with Interfaces.C; --- used for int package System.Interrupt_Management is pragma Preelaborate; diff --git a/gcc/ada/s-intman.ads b/gcc/ada/s-intman.ads index 528fbf45090..ae68d27a334 100644 --- a/gcc/ada/s-intman.ads +++ b/gcc/ada/s-intman.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -46,10 +46,8 @@ -- rather than functions. with System.OS_Interface; --- used for sigset_t with Interfaces.C; --- used for int package System.Interrupt_Management is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-aix.ads b/gcc/ada/s-osinte-aix.ads index 46caa9b6886..65db80a49de 100644 --- a/gcc/ada/s-osinte-aix.ads +++ b/gcc/ada/s-osinte-aix.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,14 +35,15 @@ -- This is a AIX (Native THREADS) version of this package -- This package encapsulates all direct interfaces to OS services that are --- needed by children of System. +-- needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-darwin.ads b/gcc/ada/s-osinte-darwin.ads index 17a48e89e62..da97aa0323c 100644 --- a/gcc/ada/s-osinte-darwin.ads +++ b/gcc/ada/s-osinte-darwin.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,12 +35,13 @@ -- This is Darwin pthreads version of this package -- This package includes all direct interfaces to OS services that are needed --- by children of System. +-- by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Elaborate_Body. It is designed to be a bottom-level (leaf) package. with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-dummy.ads b/gcc/ada/s-osinte-dummy.ads index 66e18187a2f..f459a64fdc6 100644 --- a/gcc/ada/s-osinte-dummy.ads +++ b/gcc/ada/s-osinte-dummy.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- diff --git a/gcc/ada/s-osinte-freebsd.ads b/gcc/ada/s-osinte-freebsd.ads index 86fe3f6ab7e..8794e995bd8 100644 --- a/gcc/ada/s-osinte-freebsd.ads +++ b/gcc/ada/s-osinte-freebsd.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,14 +36,15 @@ -- This is the FreeBSD PTHREADS version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-hpux-dce.ads b/gcc/ada/s-osinte-hpux-dce.ads index ac268c59480..687f9ecf6ad 100644 --- a/gcc/ada/s-osinte-hpux-dce.ads +++ b/gcc/ada/s-osinte-hpux-dce.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,14 +35,15 @@ -- This is the HP-UX version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-hpux.ads b/gcc/ada/s-osinte-hpux.ads index 61d0473e057..0e368919eeb 100644 --- a/gcc/ada/s-osinte-hpux.ads +++ b/gcc/ada/s-osinte-hpux.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,18 +34,16 @@ -- This is a HPUX 11.0 (Native THREADS) version of this package --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. - --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- This package encapsulates all direct interfaces to OS services that are +-- needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-irix.ads b/gcc/ada/s-osinte-irix.ads index 5c35032c2b7..15bd4007225 100644 --- a/gcc/ada/s-osinte-irix.ads +++ b/gcc/ada/s-osinte-irix.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,15 +34,16 @@ -- This is the SGI Pthreads version of this package --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- This package encapsulates all direct interfaces to OS services that are +-- needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-linux-hppa.ads b/gcc/ada/s-osinte-linux-hppa.ads index 1c4386bfe82..2467f09cf5b 100644 --- a/gcc/ada/s-osinte-linux-hppa.ads +++ b/gcc/ada/s-osinte-linux-hppa.ads @@ -8,7 +8,7 @@ -- (GNU/Linux-HPPA Version) -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,15 +35,16 @@ -- This is a GNU/Linux (GNU/LinuxThreads) version of this package --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- This package encapsulates all direct interfaces to OS services that are +-- needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-linux.ads b/gcc/ada/s-osinte-linux.ads index 7299123deb7..bb06c01a0b8 100644 --- a/gcc/ada/s-osinte-linux.ads +++ b/gcc/ada/s-osinte-linux.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,14 +35,15 @@ -- This is a GNU/Linux (GNU/LinuxThreads) version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-lynxos-3.ads b/gcc/ada/s-osinte-lynxos-3.ads index eb775d2fcbd..f6ceec0790a 100644 --- a/gcc/ada/s-osinte-lynxos-3.ads +++ b/gcc/ada/s-osinte-lynxos-3.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,14 +35,15 @@ -- This is a LynxOS (Native) version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-lynxos.ads b/gcc/ada/s-osinte-lynxos.ads index cc28c19819c..90107631261 100644 --- a/gcc/ada/s-osinte-lynxos.ads +++ b/gcc/ada/s-osinte-lynxos.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,14 +35,15 @@ -- This is a LynxOS (POSIX Threads) version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. -with Interfaces.C; with Ada.Unchecked_Conversion; +with Interfaces.C; + package System.OS_Interface is pragma Preelaborate; diff --git a/gcc/ada/s-osinte-mingw.ads b/gcc/ada/s-osinte-mingw.ads index e0a3edf3a18..e0a3d7c75df 100644 --- a/gcc/ada/s-osinte-mingw.ads +++ b/gcc/ada/s-osinte-mingw.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,13 +35,15 @@ -- This is a NT (native) version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with Interfaces.C.Strings; + with Ada.Unchecked_Conversion; package System.OS_Interface is @@ -75,6 +77,8 @@ package System.OS_Interface is type PLONG is access all Interfaces.C.long; type PDWORD is access all DWORD; + type BYTE is new Interfaces.C.unsigned_char; + subtype CHAR is Interfaces.C.char; type BOOL is new Boolean; for BOOL'Size use Interfaces.C.unsigned_long'Size; @@ -95,6 +99,19 @@ package System.OS_Interface is NO_ERROR : constant := 0; FUNC_ERR : constant := -1; + ----------- + -- Files -- + ----------- + + type SECURITY_ATTRIBUTES is record + nLength : DWORD; + pSecurityDescriptor : PVOID; + bInheritHandle : BOOL; + end record; + + function CloseHandle (hObject : HANDLE) return BOOL; + pragma Import (Stdcall, CloseHandle, "CloseHandle"); + ------------------------ -- System Information -- ------------------------ @@ -259,30 +276,22 @@ package System.OS_Interface is function To_PTHREAD_START_ROUTINE is new Ada.Unchecked_Conversion (System.Address, PTHREAD_START_ROUTINE); - type SECURITY_ATTRIBUTES is record - nLength : DWORD; - pSecurityDescriptor : PVOID; - bInheritHandle : BOOL; - end record; - - type PSECURITY_ATTRIBUTES is access all SECURITY_ATTRIBUTES; - function CreateThread - (pThreadAttributes : PSECURITY_ATTRIBUTES; - dwStackSize : DWORD; - pStartAddress : PTHREAD_START_ROUTINE; - pParameter : PVOID; - dwCreationFlags : DWORD; - pThreadId : PDWORD) return HANDLE; + (pThreadAttributes : access SECURITY_ATTRIBUTES; + dwStackSize : DWORD; + pStartAddress : PTHREAD_START_ROUTINE; + pParameter : PVOID; + dwCreationFlags : DWORD; + pThreadId : PDWORD) return HANDLE; pragma Import (Stdcall, CreateThread, "CreateThread"); function BeginThreadEx - (pThreadAttributes : PSECURITY_ATTRIBUTES; - dwStackSize : DWORD; - pStartAddress : PTHREAD_START_ROUTINE; - pParameter : PVOID; - dwCreationFlags : DWORD; - pThreadId : PDWORD) return HANDLE; + (pThreadAttributes : access SECURITY_ATTRIBUTES; + dwStackSize : DWORD; + pStartAddress : PTHREAD_START_ROUTINE; + pParameter : PVOID; + dwCreationFlags : DWORD; + pThreadId : PDWORD) return HANDLE; pragma Import (C, BeginThreadEx, "_beginthreadex"); Debug_Process : constant := 16#00000001#; @@ -373,11 +382,8 @@ package System.OS_Interface is -- Semaphores, Events and Mutexes -- ------------------------------------ - function CloseHandle (hObject : HANDLE) return BOOL; - pragma Import (Stdcall, CloseHandle, "CloseHandle"); - function CreateSemaphore - (pSemaphoreAttributes : PSECURITY_ATTRIBUTES; + (pSemaphoreAttributes : access SECURITY_ATTRIBUTES; lInitialCount : Interfaces.C.long; lMaximumCount : Interfaces.C.long; pName : PSZ) return HANDLE; @@ -396,7 +402,7 @@ package System.OS_Interface is pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore"); function CreateEvent - (pEventAttributes : PSECURITY_ATTRIBUTES; + (pEventAttributes : access SECURITY_ATTRIBUTES; bManualReset : BOOL; bInitialState : BOOL; pName : PSZ) return HANDLE; @@ -418,7 +424,7 @@ package System.OS_Interface is pragma Import (Stdcall, PulseEvent, "PulseEvent"); function CreateMutex - (pMutexAttributes : PSECURITY_ATTRIBUTES; + (pMutexAttributes : access SECURITY_ATTRIBUTES; bInitialOwner : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, CreateMutex, "CreateMutexA"); diff --git a/gcc/ada/s-osinte-solaris-posix.ads b/gcc/ada/s-osinte-solaris-posix.ads index d887f434f3f..c45dca19cfc 100644 --- a/gcc/ada/s-osinte-solaris-posix.ads +++ b/gcc/ada/s-osinte-solaris-posix.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,12 +35,13 @@ -- This is a Solaris (POSIX Threads) version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with Ada.Unchecked_Conversion; package System.OS_Interface is diff --git a/gcc/ada/s-osinte-solaris.ads b/gcc/ada/s-osinte-solaris.ads index 9a4a4bab756..32213ccabd4 100644 --- a/gcc/ada/s-osinte-solaris.ads +++ b/gcc/ada/s-osinte-solaris.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,12 +35,13 @@ -- This is a Solaris (native) version of this package -- This package includes all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with Ada.Unchecked_Conversion; package System.OS_Interface is diff --git a/gcc/ada/s-osinte-tru64.ads b/gcc/ada/s-osinte-tru64.ads index 98f20a6c0ae..512267780b0 100644 --- a/gcc/ada/s-osinte-tru64.ads +++ b/gcc/ada/s-osinte-tru64.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,15 +32,16 @@ -- -- ------------------------------------------------------------------------------ --- This is the DEC Unix 4.0/5.1 version of this package +-- This is the Tru64 version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with Ada.Unchecked_Conversion; package System.OS_Interface is diff --git a/gcc/ada/s-osinte-vms.ads b/gcc/ada/s-osinte-vms.ads index a572847e066..74f08ea4664 100644 --- a/gcc/ada/s-osinte-vms.ads +++ b/gcc/ada/s-osinte-vms.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,13 +35,15 @@ -- This is a OpenVMS/Alpha version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with Ada.Unchecked_Conversion; + with System.Aux_DEC; package System.OS_Interface is diff --git a/gcc/ada/s-osinte-vxworks.ads b/gcc/ada/s-osinte-vxworks.ads index 9684e78ac77..3204b4bb267 100644 --- a/gcc/ada/s-osinte-vxworks.ads +++ b/gcc/ada/s-osinte-vxworks.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,12 +35,13 @@ -- This is the VxWorks version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; + with System.VxWorks; package System.OS_Interface is diff --git a/gcc/ada/s-osinte-vxworks6.ads b/gcc/ada/s-osinte-vxworks6.ads index ad523c3aa75..4ef43c9c31f 100644 --- a/gcc/ada/s-osinte-vxworks6.ads +++ b/gcc/ada/s-osinte-vxworks6.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,7 +35,7 @@ -- This is the VxWorks 6.x version of this package -- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- that are needed by the tasking run-time (libgnarl). -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. @@ -135,12 +135,12 @@ package System.OS_Interface is -- Signal processing definitions -- ----------------------------------- - -- The how in sigprocmask(). + -- The how in sigprocmask() SIG_BLOCK : constant := 1; SIG_UNBLOCK : constant := 2; SIG_SETMASK : constant := 3; - -- The sa_flags in struct sigaction. + -- The sa_flags in struct sigaction SA_SIGINFO : constant := 16#0002#; SA_ONSTACK : constant := 16#0004#; diff --git a/gcc/ada/s-osprim-vxworks.adb b/gcc/ada/s-osprim-vxworks.adb index 901954bb53b..62fde6a7af1 100644 --- a/gcc/ada/s-osprim-vxworks.adb +++ b/gcc/ada/s-osprim-vxworks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -40,7 +40,6 @@ with System.OS_Interface; -- create a dependency on libgnarl in libgnat, which is not desirable. with Interfaces.C; --- used for type int package body System.OS_Primitives is diff --git a/gcc/ada/s-parint.adb b/gcc/ada/s-parint.adb index f8bcdcc0bb8..622c2d01062 100644 --- a/gcc/ada/s-parint.adb +++ b/gcc/ada/s-parint.adb @@ -7,7 +7,7 @@ -- B o d y -- -- (Dummy body for non-distributed case) -- -- -- --- Copyright (C) 1995-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -215,8 +215,7 @@ package body System.Partition_Interface is (E : Ada.Exceptions.Exception_Occurrence) is begin - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, Ada.Exceptions.Exception_Message (E)); + raise Program_Error with Ada.Exceptions.Exception_Message (E); end Raise_Program_Error_Unknown_Tag; ----------------- diff --git a/gcc/ada/s-pooglo.ads b/gcc/ada/s-pooglo.ads index 734a1c12826..0cb0396754b 100644 --- a/gcc/ada/s-pooglo.ads +++ b/gcc/ada/s-pooglo.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,6 +31,9 @@ -- -- ------------------------------------------------------------------------------ +-- Storage pool corresponding to default global storage pool used for +-- types for which no storage pool is specified. + with System; with System.Storage_Pools; with System.Storage_Elements; diff --git a/gcc/ada/s-pooloc.ads b/gcc/ada/s-pooloc.ads index c7fe93ed6b3..e9a975a59c9 100644 --- a/gcc/ada/s-pooloc.ads +++ b/gcc/ada/s-pooloc.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,6 +31,8 @@ -- -- ------------------------------------------------------------------------------ +-- Storage pool for use with local objects with automatic reclaim + with System.Storage_Elements; with System.Pool_Global; diff --git a/gcc/ada/s-proinf-irix-athread.ads b/gcc/ada/s-proinf-irix-athread.ads index 47f669ab8ea..83fff261117 100644 --- a/gcc/ada/s-proinf-irix-athread.ads +++ b/gcc/ada/s-proinf-irix-athread.ads @@ -46,7 +46,7 @@ package System.Program_Info is -- those explicitly created under program control. function Sproc_Stack_Size return Integer; - -- The size, in bytes, of the sproc's initial stack. + -- The size, in bytes, of the sproc's initial stack function Default_Time_Slice return Duration; -- The default time quanta for round-robin scheduling of threads of diff --git a/gcc/ada/s-rpc.adb b/gcc/ada/s-rpc.adb index a812423142d..2fa936761ea 100644 --- a/gcc/ada/s-rpc.adb +++ b/gcc/ada/s-rpc.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -39,8 +39,6 @@ -- The GLADE distribution package includes a replacement for this file -with Ada.Exceptions; use Ada.Exceptions; - package body System.RPC is CRLF : constant String := ASCII.CR & ASCII.LF; @@ -49,9 +47,6 @@ package body System.RPC is CRLF & "Distribution support not installed in your environment" & CRLF & "For information on GLADE, contact Ada Core Technologies"; - pragma Warnings (Off); - -- Kill messages about out parameters not set - ---------- -- Read -- ---------- @@ -62,7 +57,7 @@ package body System.RPC is Last : out Ada.Streams.Stream_Element_Offset) is begin - Raise_Exception (Program_Error'Identity, Msg); + raise Program_Error with Msg; end Read; ----------- @@ -74,7 +69,7 @@ package body System.RPC is Item : Ada.Streams.Stream_Element_Array) is begin - Raise_Exception (Program_Error'Identity, Msg); + raise Program_Error with Msg; end Write; ------------ @@ -87,7 +82,7 @@ package body System.RPC is Result : access Params_Stream_Type) is begin - Raise_Exception (Program_Error'Identity, Msg); + raise Program_Error with Msg; end Do_RPC; ------------ @@ -99,7 +94,7 @@ package body System.RPC is Params : access Params_Stream_Type) is begin - Raise_Exception (Program_Error'Identity, Msg); + raise Program_Error with Msg; end Do_APC; ---------------------------- @@ -110,6 +105,7 @@ package body System.RPC is (Partition : Partition_ID; Receiver : RPC_Receiver) is + pragma Unreferenced (Partition, Receiver); begin null; end Establish_RPC_Receiver; diff --git a/gcc/ada/s-shasto.adb b/gcc/ada/s-shasto.adb index 85e47eda428..5dd775725bb 100644 --- a/gcc/ada/s-shasto.adb +++ b/gcc/ada/s-shasto.adb @@ -31,7 +31,6 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Exceptions; with Ada.IO_Exceptions; with Ada.Streams; @@ -483,10 +482,8 @@ package body System.Shared_Storage is -- Error if we cannot create the file when others => - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, - "Cannot create shared variable file for """ & - S & '"'); -- " + raise Program_Error with + "Cannot create shared variable file for """ & S & '"'; end; end; diff --git a/gcc/ada/s-soflin.adb b/gcc/ada/s-soflin.adb index c0787d1cc79..c54a31e045e 100644 --- a/gcc/ada/s-soflin.adb +++ b/gcc/ada/s-soflin.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,15 +36,13 @@ pragma Compiler_Unit; pragma Warnings (On); pragma Polling (Off); --- We must turn polling off for this unit, because otherwise we get --- an infinite loop from the code within the Poll routine itself. +-- We must turn polling off for this unit, because otherwise we get an +-- infinite loop from the code within the Poll routine itself. with System.Parameters; --- Used for Sec_Stack_Ratio pragma Warnings (Off); --- Disable warnings since System.Secondary_Stack is currently not --- Preelaborate +-- Disable warnings since System.Secondary_Stack is currently not Preelaborate with System.Secondary_Stack; pragma Warnings (On); diff --git a/gcc/ada/s-solita.adb b/gcc/ada/s-solita.adb index 0ce4b73fe32..ecf0f238995 100644 --- a/gcc/ada/s-solita.adb +++ b/gcc/ada/s-solita.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,31 +32,20 @@ ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); --- Turn off subprogram alpha ordering check, since we group soft link --- bodies and dummy soft link bodies together separately in this unit. +-- Turn off subprogram alpha ordering check, since we group soft link bodies +-- and dummy soft link bodies together separately in this unit. pragma Polling (Off); --- Turn polling off for this package. We don't need polling during any --- of the routines in this package, and more to the point, if we try --- to poll it can cause infinite loops. +-- Turn polling off for this package. We don't need polling during any of the +-- routines in this package, and more to the point, if we try to poll it can +-- cause infinite loops. -with System.Task_Primitives.Operations; --- Used for Self --- Timed_Delay +with Ada.Exceptions; +with Ada.Exceptions.Is_Null_Occurrence; +with System.Task_Primitives.Operations; with System.Tasking; --- Used for Task_Id --- Cause_Of_Termination - with System.Stack_Checking; --- Used for Stack_Access - -with Ada.Exceptions; --- Used for Exception_Id --- Exception_Occurrence --- Save_Occurrence - -with Ada.Exceptions.Is_Null_Occurrence; package body System.Soft_Links.Tasking is diff --git a/gcc/ada/s-stchop.adb b/gcc/ada/s-stchop.adb index aacdad94708..e403bc9b15a 100644 --- a/gcc/ada/s-stchop.adb +++ b/gcc/ada/s-stchop.adb @@ -39,8 +39,6 @@ pragma Restrictions (No_Elaboration_Code); -- We want to guarantee the absence of elaboration code because the -- binder does not handle references to this package. -with Ada.Exceptions; - with System.Storage_Elements; use System.Storage_Elements; with System.Parameters; use System.Parameters; with System.Soft_Links; @@ -216,9 +214,7 @@ package body System.Stack_Checking.Operations is (not Stack_Grows_Down and then Stack_Address < Frame_Address) then - Ada.Exceptions.Raise_Exception - (E => Storage_Error'Identity, - Message => "stack overflow detected"); + raise Storage_Error with "stack overflow detected"; end if; -- This function first does a "cheap" check which is correct @@ -270,9 +266,7 @@ package body System.Stack_Checking.Operations is (not Stack_Grows_Down and then Stack_Address > My_Stack.Limit) then - Ada.Exceptions.Raise_Exception - (E => Storage_Error'Identity, - Message => "stack overflow detected"); + raise Storage_Error with "stack overflow detected"; end if; return My_Stack; diff --git a/gcc/ada/s-taasde.adb b/gcc/ada/s-taasde.adb index 28e31e0ec93..84a8504fb11 100644 --- a/gcc/ada/s-taasde.adb +++ b/gcc/ada/s-taasde.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,46 +35,17 @@ pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during -- tasking operations. It causes infinite loops and other problems. -with Ada.Exceptions; --- Used for Raise_Exception +with Ada.Unchecked_Conversion; +with Ada.Task_Identification; with System.Task_Primitives.Operations; --- Used for Write_Lock, --- Unlock, --- Self, --- Monotonic_Clock, --- Self, --- Timed_Sleep, --- Wakeup, --- Yield - with System.Tasking.Utilities; --- Used for Make_Independent - with System.Tasking.Initialization; --- Used for Defer_Abort --- Undefer_Abort - with System.Tasking.Debug; --- Used for Trace - with System.OS_Primitives; --- used for Max_Sensible_Delay - -with Ada.Task_Identification; --- used for Task_Id type - with System.Interrupt_Management.Operations; --- used for Setup_Interrupt_Mask - with System.Parameters; --- used for Single_Lock --- Runtime_Traces - with System.Traces.Tasking; --- used for Send_Trace_Info - -with Ada.Unchecked_Conversion; package body System.Tasking.Async_Delays is @@ -228,8 +199,7 @@ package body System.Tasking.Async_Delays is "async delay from within abort-deferred region"); if Self_Id.ATC_Nesting_Level = ATC_Level'Last then - Ada.Exceptions.Raise_Exception (Storage_Error'Identity, - "not enough ATC nesting levels"); + raise Storage_Error with "not enough ATC nesting levels"; end if; Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level + 1; diff --git a/gcc/ada/s-taenca.adb b/gcc/ada/s-taenca.adb index 3da82bf60ba..0f4b0c8fa4d 100644 --- a/gcc/ada/s-taenca.adb +++ b/gcc/ada/s-taenca.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,36 +32,13 @@ ------------------------------------------------------------------------------ with System.Task_Primitives.Operations; --- used for STPO.Write_Lock --- Unlock --- STPO.Get_Priority --- Sleep --- Timed_Sleep - with System.Tasking.Initialization; --- used for Change_Base_Priority --- Defer_Abort/Undefer_Abort - with System.Tasking.Protected_Objects.Entries; --- used for To_Protection - with System.Tasking.Protected_Objects.Operations; --- used for PO_Service_Entries - with System.Tasking.Queuing; --- used for Requeue_Call_With_New_Prio --- Onqueue --- Dequeue_Call - with System.Tasking.Utilities; --- used for Exit_One_ATC_Level - with System.Parameters; --- used for Single_Lock --- Runtime_Traces - with System.Traces; --- used for Send_Trace_Info package body System.Tasking.Entry_Calls is diff --git a/gcc/ada/s-taprob.adb b/gcc/ada/s-taprob.adb index 603d9a268d7..547dcb72264 100644 --- a/gcc/ada/s-taprob.adb +++ b/gcc/ada/s-taprob.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2006, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,19 +37,9 @@ pragma Polling (Off); -- tasking operations. It causes infinite loops and other problems. with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Self --- Set_Ceiling - with System.Parameters; --- used for Runtime_Traces - with System.Traces; --- used for Send_Trace_Info - with System.Soft_Links.Tasking; --- Used for Init_Tasking_Soft_Links package body System.Tasking.Protected_Objects is diff --git a/gcc/ada/s-taprop-dummy.adb b/gcc/ada/s-taprop-dummy.adb index a64a61cd9dd..20f8404e0fc 100644 --- a/gcc/ada/s-taprop-dummy.adb +++ b/gcc/ada/s-taprop-dummy.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,15 +33,14 @@ -- This is a no tasking version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.Error_Reporting; --- used for Shutdown package body System.Task_Primitives.Operations is diff --git a/gcc/ada/s-taprop-hpux-dce.adb b/gcc/ada/s-taprop-hpux-dce.adb index b962b890a07..329c56f8ccb 100644 --- a/gcc/ada/s-taprop-hpux-dce.adb +++ b/gcc/ada/s-taprop-hpux-dce.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,50 +33,34 @@ -- This is a HP-UX DCE threads (HPUX 10) version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; + +with Interfaces.C; +with System.Tasking.Debug; with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +with System.OS_Primitives; +with System.Task_Primitives.Interrupt_Operations; pragma Warnings (Off); with System.Interrupt_Management.Operations; --- used for Set_Interrupt_Mask --- All_Tasks_Mask pragma Elaborate_All (System.Interrupt_Management.Operations); - pragma Warnings (On); -with System.OS_Primitives; --- used for Delay_Modes - -with Interfaces.C; --- used for int --- size_t - -with System.Task_Primitives.Interrupt_Operations; --- used for Get_Interrupt_ID - with System.Soft_Links; --- used for Defer/Undefer_Abort - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; diff --git a/gcc/ada/s-taprop-irix.adb b/gcc/ada/s-taprop-irix.adb index 0ca8ccac519..a7221903cc8 100644 --- a/gcc/ada/s-taprop-irix.adb +++ b/gcc/ada/s-taprop-irix.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,44 +33,30 @@ -- This is a IRIX (pthread library) version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. + +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; with Interfaces.C; --- used for int --- size_t with System.Task_Info; - with System.Tasking.Debug; --- used for Known_Tasks - with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID - with System.OS_Primitives; --- used for Delay_Modes - with System.IO; --- used for Put_Line with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -920,13 +906,16 @@ package body System.Task_Primitives.Operations is Succeeded := Result = 0; - -- The following needs significant commenting ??? + if Succeeded then - if T.Common.Task_Info /= null then - T.Common.Base_Priority := T.Common.Task_Info.Priority; - Set_Priority (T, T.Common.Task_Info.Priority); - else - Set_Priority (T, Priority); + -- The following needs significant commenting ??? + + if T.Common.Task_Info /= null then + T.Common.Base_Priority := T.Common.Task_Info.Priority; + Set_Priority (T, T.Common.Task_Info.Priority); + else + Set_Priority (T, Priority); + end if; end if; Result := pthread_attr_destroy (Attributes'Access); diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb index 21e2a6589c6..6c64f341eec 100644 --- a/gcc/ada/s-taprop-linux.adb +++ b/gcc/ada/s-taprop-linux.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,51 +33,31 @@ -- This is a GNU/Linux (GNU/LinuxThreads) version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. + +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; with Interfaces.C; --- used for int --- size_t with System.Task_Info; --- used for Unspecified_Task_Info - with System.Tasking.Debug; --- used for Known_Tasks - with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID - with System.OS_Primitives; --- used for Delay_Modes +with System.Storage_Elements; +with System.Stack_Checking.Operations; with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with System.Storage_Elements; -with System.Stack_Checking.Operations; --- Used for Invalidate_Stack_Cache and Notify_Stack_Attributes; - -with Ada.Exceptions; --- used for Raise_Exception --- Raise_From_Signal_Handler --- Exception_Id - -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -273,12 +253,11 @@ package body System.Task_Primitives.Operations is -- Initialize_Lock -- --------------------- - -- Note: mutexes and cond_variables needed per-task basis are - -- initialized in Initialize_TCB and the Storage_Error is - -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...) - -- used in RTS is initialized before any status change of RTS. - -- Therefore rasing Storage_Error in the following routines - -- should be able to be handled safely. + -- Note: mutexes and cond_variables needed per-task basis are initialized + -- in Initialize_TCB and the Storage_Error is handled. Other mutexes (such + -- as RTS_Lock, Memory_Lock...) used in RTS is initialized before any + -- status change of RTS. Therefore rasing Storage_Error in the following + -- routines should be able to be handled safely. procedure Initialize_Lock (Prio : System.Any_Priority; @@ -294,8 +273,7 @@ package body System.Task_Primitives.Operations is pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then - Ada.Exceptions.Raise_Exception (Storage_Error'Identity, - "Failed to allocate a lock"); + raise Storage_Error with "Failed to allocate a lock"; end if; end Initialize_Lock; @@ -920,7 +898,14 @@ package body System.Task_Primitives.Operations is To_Address (T)); pragma Assert (Result = 0 or else Result = EAGAIN); - Succeeded := Result = 0; + if Result /= 0 then + Succeeded := False; + Result := pthread_attr_destroy (Attributes'Access); + pragma Assert (Result = 0); + return; + end if; + + Succeeded := True; -- Handle Task_Info diff --git a/gcc/ada/s-taprop-lynxos.adb b/gcc/ada/s-taprop-lynxos.adb index cc4e74a8bd7..31b36eca579 100644 --- a/gcc/ada/s-taprop-lynxos.adb +++ b/gcc/ada/s-taprop-lynxos.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,44 +31,31 @@ -- -- ------------------------------------------------------------------------------ --- This is a LynxOS version of this file, adapted to make --- SCHED_FIFO and ceiling locking (Annex D compliance) work properly +-- This is a LynxOS version of this file, adapted to make SCHED_FIFO and +-- ceiling locking (Annex D compliance) work properly. --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks +with Ada.Unchecked_Deallocation; -with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +with Interfaces.C; +with System.Tasking.Debug; +with System.Interrupt_Management; with System.OS_Primitives; --- used for Delay_Modes - with System.Task_Info; --- used for Task_Info_Type - -with Interfaces.C; --- used for int --- size_t with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -996,7 +983,9 @@ package body System.Task_Primitives.Operations is Result := pthread_attr_destroy (Attributes'Access); pragma Assert (Result = 0); - Set_Priority (T, Priority); + if Succeeded then + Set_Priority (T, Priority); + end if; end Create_Task; ------------------ diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb index d0ba725272d..adf1a31ec45 100644 --- a/gcc/ada/s-taprop-mingw.adb +++ b/gcc/ada/s-taprop-mingw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,42 +33,29 @@ -- This is a NT (native) version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks - -with System.OS_Primitives; --- used for Delay_Modes +with Ada.Unchecked_Deallocation; with Interfaces.C; --- used for int --- size_t - with Interfaces.C.Strings; --- used for Null_Ptr +with System.Tasking.Debug; +with System.OS_Primitives; with System.Task_Info; --- used for Unspecified_Task_Info - with System.Interrupt_Management; --- used for Initialize with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization because -- the later is a higher level package that we shouldn't depend on. For -- example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -913,7 +900,8 @@ package body System.Task_Primitives.Operations is -- Step 1: Create the thread in blocked mode if hTask = 0 then - raise Storage_Error; + Succeeded := False; + return; end if; -- Step 2: set its TCB diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb index 7d3df5c0755..816bb50a7b6 100644 --- a/gcc/ada/s-taprop-posix.adb +++ b/gcc/ada/s-taprop-posix.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,48 +33,35 @@ -- This is a POSIX-like version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. --- Note: this file can only be used for POSIX compliant systems that --- implement SCHED_FIFO and Ceiling Locking correctly. +-- Note: this file can only be used for POSIX compliant systems that implement +-- SCHED_FIFO and Ceiling Locking correctly. -- For configurations where SCHED_FIFO and priority ceiling are not a -- requirement, this file can also be used (e.g AiX threads) pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; -with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +with Interfaces.C; +with System.Tasking.Debug; +with System.Interrupt_Management; with System.OS_Primitives; --- used for Delay_Modes - with System.Task_Info; --- used for Task_Info_Type - -with Interfaces.C; --- used for int --- size_t with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -1013,7 +1000,9 @@ package body System.Task_Primitives.Operations is Result := pthread_attr_destroy (Attributes'Access); pragma Assert (Result = 0); - Set_Priority (T, Priority); + if Succeeded then + Set_Priority (T, Priority); + end if; end Create_Task; ------------------ diff --git a/gcc/ada/s-taprop-solaris.adb b/gcc/ada/s-taprop-solaris.adb index 330519db8ea..068d3401f62 100644 --- a/gcc/ada/s-taprop-solaris.adb +++ b/gcc/ada/s-taprop-solaris.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,47 +33,32 @@ -- This is a Solaris (native) version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks +with Ada.Unchecked_Deallocation; -with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +with Interfaces.C; +with System.Tasking.Debug; +with System.Interrupt_Management; with System.OS_Primitives; --- used for Delay_Modes +with System.Task_Info; pragma Warnings (Off); with System.OS_Lib; --- used for String_Access, Getenv - pragma Warnings (On); -with Interfaces.C; --- used for int --- size_t - -with System.Task_Info; --- to initialize Task_Info for a C thread, in function Self - with System.Soft_Links; --- used for Defer/Undefer_Abort - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; diff --git a/gcc/ada/s-taprop-tru64.adb b/gcc/ada/s-taprop-tru64.adb index 0b4620b59ac..ace4756fea0 100644 --- a/gcc/ada/s-taprop-tru64.adb +++ b/gcc/ada/s-taprop-tru64.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,46 +31,31 @@ -- -- ------------------------------------------------------------------------------ --- This is a DEC Unix 4.0d version of this package +-- This is a Tru64 version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks +with Ada.Unchecked_Deallocation; -with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Interrupt_ID +with Interfaces; +with Interfaces.C; +with System.Tasking.Debug; +with System.Interrupt_Management; with System.OS_Primitives; --- used for Delay_Modes - with System.Task_Info; --- used for Task_Info_Type - -with Interfaces; --- used for Shift_Left - -with Interfaces.C; --- used for int --- size_t with System.Soft_Links; --- used for Abort_Defer/Undefer - -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -948,7 +933,7 @@ package body System.Task_Primitives.Operations is Result := pthread_attr_destroy (Attributes'Access); pragma Assert (Result = 0); - if T.Common.Task_Info /= null then + if Succeeded and then T.Common.Task_Info /= null then -- ??? We're using a process-wide function to implement a task -- specific characteristic. diff --git a/gcc/ada/s-taprop-vms.adb b/gcc/ada/s-taprop-vms.adb index 7094ed5f978..f1be10194a4 100644 --- a/gcc/ada/s-taprop-vms.adb +++ b/gcc/ada/s-taprop-vms.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,32 +33,22 @@ -- This is a OpenVMS/Alpha version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks - -with System.OS_Primitives; --- used for Delay_Modes +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; with Interfaces.C; --- used for int --- size_t +with System.Tasking.Debug; +with System.OS_Primitives; with System.Soft_Links; --- used for Get_Exc_Stack_Addr --- Abort_Defer/Undefer - with System.Aux_DEC; --- used for Short_Address - -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; package body System.Task_Primitives.Operations is diff --git a/gcc/ada/s-taprop-vxworks.adb b/gcc/ada/s-taprop-vxworks.adb index 5eb4bc99a68..c6469cd2b05 100644 --- a/gcc/ada/s-taprop-vxworks.adb +++ b/gcc/ada/s-taprop-vxworks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,35 +33,27 @@ -- This is the VxWorks version of this package --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. -with System.Tasking.Debug; --- used for Known_Tasks - -with System.Interrupt_Management; --- used for Keep_Unmasked --- Abort_Task_Interrupt --- Signal_ID --- Initialize_Interrupts +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; with Interfaces.C; -with System.Soft_Links; --- used for Abort_Defer/Undefer +with System.Tasking.Debug; +with System.Interrupt_Management; +with System.Soft_Links; -- We use System.Soft_Links instead of System.Tasking.Initialization --- because the later is a higher level package that we shouldn't depend on. --- For example when using the restricted run time, it is replaced by +-- because the later is a higher level package that we shouldn't depend +-- on. For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. -with Ada.Unchecked_Conversion; -with Ada.Unchecked_Deallocation; - package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; @@ -754,9 +746,9 @@ package body System.Task_Primitives.Operations is pragma Atomic_Components (Prio_Array_Type); Prio_Array : Prio_Array_Type; - -- Global array containing the id of the currently running task for - -- each priority. Note that we assume that we are on a single processor - -- with run-till-blocked scheduling. + -- Global array containing the id of the currently running task for each + -- priority. Note that we assume that we are on a single processor with + -- run-till-blocked scheduling. procedure Set_Priority (T : Task_Id; @@ -776,7 +768,7 @@ package body System.Task_Primitives.Operations is and then Loss_Of_Inheritance and then Prio < T.Common.Current_Priority then - -- Annex D requirement (RM D.2.2(9)) + -- Annex D requirement (RM D.2.2(9)): -- If the task drops its priority due to the loss of inherited -- priority, it is added at the head of the ready queue for its @@ -852,7 +844,8 @@ package body System.Task_Primitives.Operations is Unlock_RTS; - -- If stack checking is enabled set the stack limit for this task. + -- If stack checking is enabled, set the stack limit for this task + if Set_Stack_Limit_Hook /= null then Set_Stack_Limit_Hook.all; end if; @@ -985,10 +978,9 @@ package body System.Task_Primitives.Operations is Succeeded := False; else Succeeded := True; + Task_Creation_Hook (T.Common.LL.Thread); + Set_Priority (T, Priority); end if; - - Task_Creation_Hook (T.Common.LL.Thread); - Set_Priority (T, Priority); end Create_Task; ------------------ @@ -1077,6 +1069,9 @@ package body System.Task_Primitives.Operations is -------------- procedure Finalize (S : in out Suspension_Object) is + pragma Unmodified (S); + -- S may be modified on other targets, but not on VxWorks + Result : STATUS; begin diff --git a/gcc/ada/s-taprop.ads b/gcc/ada/s-taprop.ads index d45ef18b990..7938ae1002e 100644 --- a/gcc/ada/s-taprop.ads +++ b/gcc/ada/s-taprop.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,17 +31,12 @@ -- -- ------------------------------------------------------------------------------ --- This package contains all the GNULL primitives that interface directly --- with the underlying OS. +-- This package contains all the GNULL primitives that interface directly with +-- the underlying OS. with System.Parameters; --- used for Size_Type - with System.Tasking; --- used for Task_Id - with System.OS_Interface; --- used for Thread_Id package System.Task_Primitives.Operations is pragma Preelaborate; diff --git a/gcc/ada/s-tarest.adb b/gcc/ada/s-tarest.adb index 509b0d030ef..08802c6e22f 100644 --- a/gcc/ada/s-tarest.adb +++ b/gcc/ada/s-tarest.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -46,31 +46,18 @@ pragma Polling (Off); -- tasking operations. It causes infinite loops and other problems. with Ada.Exceptions; --- used for Exception_Occurrence with System.Task_Primitives.Operations; --- used for Enter_Task --- Write_Lock --- Unlock --- Wakeup --- Get_Priority - -with System.Soft_Links; --- used for the non-tasking routines (*_NT) that refer to global data. --- They are needed here before the tasking run time has been elaborated. --- used for Create_TSD --- This package also provides initialization routines for task specific data. --- The GNARL must call these to be sure that all non-tasking --- Ada constructs will work. - with System.Soft_Links.Tasking; --- Used for Init_Tasking_Soft_Links - with System.Secondary_Stack; --- used for SS_Init; - with System.Storage_Elements; --- used for Storage_Array; + +with System.Soft_Links; +-- Used for the non-tasking routines (*_NT) that refer to global data. They +-- are needed here before the tasking run time has been elaborated. used for +-- Create_TSD This package also provides initialization routines for task +-- specific data. The GNARL must call these to be sure that all non-tasking +-- Ada constructs will work. package body System.Tasking.Restricted.Stages is diff --git a/gcc/ada/s-tarest.ads b/gcc/ada/s-tarest.ads index 1525bd9ea1e..6f0e36b43e6 100644 --- a/gcc/ada/s-tarest.ads +++ b/gcc/ada/s-tarest.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -46,10 +46,7 @@ -- System.Protected_Objects.Single_Entry with System.Task_Info; --- used for Task_Info_Type - with System.Parameters; --- used for Size_Type package System.Tasking.Restricted.Stages is pragma Elaborate_Body; diff --git a/gcc/ada/s-tasdeb.ads b/gcc/ada/s-tasdeb.ads index 9aebe943d4d..61fa1ba6b3a 100644 --- a/gcc/ada/s-tasdeb.ads +++ b/gcc/ada/s-tasdeb.ads @@ -61,7 +61,7 @@ package System.Tasking.Debug is -- task specific state. function Get_User_State return Long_Integer; - -- Return the user state for the current task. + -- Return the user state for the current task ------------------------- -- General GDB support -- diff --git a/gcc/ada/s-tasinf-linux.ads b/gcc/ada/s-tasinf-linux.ads index 603a1189b6b..25a2bd3b5a7 100644 --- a/gcc/ada/s-tasinf-linux.ads +++ b/gcc/ada/s-tasinf-linux.ads @@ -41,7 +41,7 @@ -- This unit may be used directly from an application program by providing -- an appropriate WITH, and the interface can be expected to remain stable. --- This is the GNU/Linux version of this module. +-- This is the GNU/Linux version of this module with System.OS_Interface; diff --git a/gcc/ada/s-tasinf-mingw.ads b/gcc/ada/s-tasinf-mingw.ads index baf2d8eaedc..056044e5f09 100644 --- a/gcc/ada/s-tasinf-mingw.ads +++ b/gcc/ada/s-tasinf-mingw.ads @@ -41,7 +41,7 @@ -- This unit may be used directly from an application program by providing -- an appropriate WITH, and the interface can be expected to remain stable. --- This is the Windows (native) version of this module. +-- This is the Windows (native) version of this module with System.OS_Interface; diff --git a/gcc/ada/s-tasini.adb b/gcc/ada/s-tasini.adb index 5b3bb2d29e5..557bf9a8cb3 100644 --- a/gcc/ada/s-tasini.adb +++ b/gcc/ada/s-tasini.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,38 +32,22 @@ ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); --- Turn off subprogram alpha ordering check, since we group soft link --- bodies and dummy soft link bodies together separately in this unit. +-- Turn off subprogram alpha ordering check, since we group soft link bodies +-- and dummy soft link bodies together separately in this unit. pragma Polling (Off); --- Turn polling off for this package. We don't need polling during any --- of the routines in this package, and more to the point, if we try --- to poll it can cause infinite loops. +-- Turn polling off for this package. We don't need polling during any of the +-- routines in this package, and more to the point, if we try to poll it can +-- cause infinite loops. with Ada.Exceptions; --- Used for Exception_Occurrence_Access with System.Task_Primitives; --- Used for Lock - with System.Task_Primitives.Operations; --- Used for Set_Priority --- Write_Lock --- Unlock --- Initialize_Lock - with System.Soft_Links; --- Used for the non-tasking routines (*_NT) that refer to global data. --- They are needed here before the tasking run time has been elaborated. - with System.Soft_Links.Tasking; --- Used for Init_Tasking_Soft_Links - with System.Tasking.Debug; --- Used for Trace - with System.Parameters; --- used for Single_Lock package body System.Tasking.Initialization is diff --git a/gcc/ada/s-taskin.adb b/gcc/ada/s-taskin.adb index 3a4cbe55945..7d78f5112a7 100644 --- a/gcc/ada/s-taskin.adb +++ b/gcc/ada/s-taskin.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,14 +32,11 @@ ------------------------------------------------------------------------------ pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.Task_Primitives.Operations; --- used for Self - with System.Storage_Elements; --- Needed for initializing Stack_Info.Size package body System.Tasking is diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads index e8c0653deb6..045f176db02 100644 --- a/gcc/ada/s-taskin.ads +++ b/gcc/ada/s-taskin.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,25 +37,13 @@ -- Any changes to this interface may require corresponding compiler changes. with Ada.Exceptions; --- Used for Exception_Id --- Exception_Occurrence +with Ada.Unchecked_Conversion; with System.Parameters; --- used for Size_Type - with System.Task_Info; --- used for Task_Info_Type - with System.Soft_Links; --- used for TSD - with System.Task_Primitives; --- used for Private_Data - with System.Stack_Usage; --- used for Stack_Analyzer - -with Ada.Unchecked_Conversion; package System.Tasking is pragma Preelaborate; diff --git a/gcc/ada/s-tasloc.adb b/gcc/ada/s-tasloc.adb index 71a8fce635a..6220c6ba022 100755 --- a/gcc/ada/s-tasloc.adb +++ b/gcc/ada/s-tasloc.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2007, AdaCore -- +-- Copyright (C) 1997-2008, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,7 +32,6 @@ ------------------------------------------------------------------------------ with System.Soft_Links; --- used for Lock_Task, Unlock_Task package body System.Task_Lock is diff --git a/gcc/ada/s-taspri-dummy.ads b/gcc/ada/s-taspri-dummy.ads index 76be710e60e..06cb9c13d6e 100644 --- a/gcc/ada/s-taspri-dummy.ads +++ b/gcc/ada/s-taspri-dummy.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,8 +34,8 @@ -- This is a no tasking version of this package pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-hpux-dce.ads b/gcc/ada/s-taspri-hpux-dce.ads index 311df3fcae2..9ed8b011129 100644 --- a/gcc/ada/s-taspri-hpux-dce.ads +++ b/gcc/ada/s-taspri-hpux-dce.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,13 +36,10 @@ -- This package provides low-level support for most tasking features pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-lynxos.ads b/gcc/ada/s-taspri-lynxos.ads index 03eb447ac3f..7d85e67392f 100644 --- a/gcc/ada/s-taspri-lynxos.ads +++ b/gcc/ada/s-taspri-lynxos.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,13 +35,10 @@ -- This is a LynxOS version of this package, derived from s-taspri-posix.ads pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-mingw.ads b/gcc/ada/s-taspri-mingw.ads index 8af68156a10..5997cba640c 100644 --- a/gcc/ada/s-taspri-mingw.ads +++ b/gcc/ada/s-taspri-mingw.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,13 +34,10 @@ -- This is a NT (native) version of this package pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-posix.ads b/gcc/ada/s-taspri-posix.ads index 22bad81b4e0..c59a780c161 100644 --- a/gcc/ada/s-taspri-posix.ads +++ b/gcc/ada/s-taspri-posix.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,13 +37,10 @@ -- Note: this file can only be used for POSIX compliant systems pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-solaris.ads b/gcc/ada/s-taspri-solaris.ads index 3f4772bfc01..810f89c61a6 100644 --- a/gcc/ada/s-taspri-solaris.ads +++ b/gcc/ada/s-taspri-solaris.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,16 +36,13 @@ -- This package provides low-level support for most tasking features pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. - -with System.OS_Interface; --- used for mutex_t --- cond_t --- thread_t +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with Ada.Unchecked_Conversion; +with System.OS_Interface; + package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-tru64.ads b/gcc/ada/s-taspri-tru64.ads index db281adc32e..d666dfea396 100644 --- a/gcc/ada/s-taspri-tru64.ads +++ b/gcc/ada/s-taspri-tru64.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,17 +36,12 @@ -- This package provides low-level support for most tasking features pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with Interfaces.C; --- used for int --- size_t with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-vms.ads b/gcc/ada/s-taspri-vms.ads index 7f3d8eae3e8..d2e78cb6cb6 100644 --- a/gcc/ada/s-taspri-vms.ads +++ b/gcc/ada/s-taspri-vms.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,17 +36,12 @@ -- This package provides low-level support for most tasking features pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with Interfaces.C; --- used for int --- size_t with System.OS_Interface; --- used for pthread_mutex_t --- pthread_cond_t --- pthread_t package System.Task_Primitives is pragma Preelaborate; diff --git a/gcc/ada/s-taspri-vxworks.ads b/gcc/ada/s-taspri-vxworks.ads index e42535cae00..b499b217bec 100644 --- a/gcc/ada/s-taspri-vxworks.ads +++ b/gcc/ada/s-taspri-vxworks.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2006 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,8 +34,8 @@ -- This is a VxWorks version of this package pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.OS_Interface; diff --git a/gcc/ada/s-tasque.adb b/gcc/ada/s-tasque.adb index 55b41c7fae9..7a4aac8d386 100644 --- a/gcc/ada/s-tasque.adb +++ b/gcc/ada/s-tasque.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,19 +31,13 @@ -- -- ------------------------------------------------------------------------------ --- This version of the body implements queueing policy according to the --- policy specified by the pragma Queuing_Policy. When no such pragma --- is specified FIFO policy is used as default. +-- This version of the body implements queueing policy according to the policy +-- specified by the pragma Queuing_Policy. When no such pragma is specified +-- FIFO policy is used as default. with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock - with System.Tasking.Initialization; --- used for Wakeup_Entry_Caller - with System.Parameters; --- used for Single_Lock package body System.Tasking.Queuing is diff --git a/gcc/ada/s-tasren.adb b/gcc/ada/s-tasren.adb index 40111c8fd3a..d7cbc01ebc8 100644 --- a/gcc/ada/s-tasren.adb +++ b/gcc/ada/s-tasren.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,53 +32,15 @@ ------------------------------------------------------------------------------ with System.Task_Primitives.Operations; --- used for Get_Priority --- Set_Priority --- Write_Lock --- Unlock --- Sleep --- Wakeup --- Timed_Sleep - with System.Tasking.Entry_Calls; --- Used for Wait_For_Completion --- Wait_For_Completion_With_Timeout --- Wait_Until_Abortable - with System.Tasking.Initialization; --- used for Defer_Abort --- Undefer_Abort --- Do_Pending_Action - with System.Tasking.Queuing; --- used for Enqueue --- Dequeue_Head --- Select_Task_Entry_Call --- Count_Waiting - with System.Tasking.Utilities; --- used for Check_Exception --- Make_Passive --- Wakeup_Entry_Caller --- Exit_One_ATC_Level - with System.Tasking.Protected_Objects.Operations; --- used for PO_Do_Or_Queue --- PO_Service_Entries --- Lock_Entries - with System.Tasking.Debug; --- used for Trace - with System.Restrictions; --- used for Abort_Allowed - with System.Parameters; --- used for Single_Lock --- Runtime_Traces - with System.Traces.Tasking; --- used for Send_Trace_Info package body System.Tasking.Rendezvous is @@ -402,8 +364,7 @@ package body System.Tasking.Rendezvous is if System.Tasking.Detect_Blocking and then STPO.Self.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; Call_Synchronous @@ -1037,8 +998,7 @@ package body System.Tasking.Rendezvous is end if; Initialization.Undefer_Abort (Self_Id); - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "Entry call not a delay mode"); + raise Program_Error with "Entry call not a delay mode"; end if; end case; @@ -1351,8 +1311,7 @@ package body System.Tasking.Rendezvous is if System.Tasking.Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; if Parameters.Runtime_Traces then @@ -1719,8 +1678,7 @@ package body System.Tasking.Rendezvous is if System.Tasking.Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; Initialization.Defer_Abort (Self_Id); diff --git a/gcc/ada/s-tasren.ads b/gcc/ada/s-tasren.ads index 67fdc5a1437..73f74ba75fe 100644 --- a/gcc/ada/s-tasren.ads +++ b/gcc/ada/s-tasren.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,10 +35,8 @@ -- Any changes to this interface may require corresponding compiler changes. with Ada.Exceptions; --- Used for, Exception_Id with System.Tasking.Protected_Objects.Entries; --- used for Protection_Entries package System.Tasking.Rendezvous is diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb index 9c574f06dc8..22da42bb08f 100644 --- a/gcc/ada/s-tassta.adb +++ b/gcc/ada/s-tassta.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,79 +32,36 @@ ------------------------------------------------------------------------------ pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with Ada.Exceptions; --- Used for Raise_Exception +with Ada.Unchecked_Deallocation; with System.Tasking.Debug; --- Used for enabling tasking facilities with gdb - with System.Address_Image; --- Used for the function itself - with System.Task_Primitives.Operations; --- Used for Finalize_Lock --- Enter_Task --- Write_Lock --- Unlock --- Sleep --- Wakeup --- Get_Priority --- Lock/Unlock_RTS --- New_ATCB - -with System.Soft_Links; --- These are procedure pointers to non-tasking routines that use task --- specific data. In the absence of tasking, these routines refer to global --- data. In the presense of tasking, they must be replaced with pointers to --- task-specific versions. Also used for Create_TSD, Destroy_TSD, --- Get_Current_Excep, Finalize_Global_List, Task_Termination, Handler. - -with System.Tasking.Initialization; --- Used for Remove_From_All_Tasks_List --- Defer_Abort --- Undefer_Abort --- Finalize_Attributes_Link --- Initialize_Attributes_Link - -pragma Elaborate_All (System.Tasking.Initialization); --- This insures that tasking is initialized if any tasks are created - with System.Tasking.Utilities; --- Used for Make_Passive --- Abort_One_Task --- Abort_Tasks - with System.Tasking.Queuing; --- Used for Dequeue_Head - with System.Tasking.Rendezvous; --- Used for Call_Simple - with System.OS_Primitives; --- Used for Delay_Modes - with System.Secondary_Stack; --- Used for SS_Init - with System.Storage_Elements; --- Used for Storage_Array - with System.Restrictions; --- Used for Abort_Allowed - with System.Standard_Library; --- Used for Exception_Trace - with System.Traces.Tasking; --- Used for Send_Trace_Info +with System.Stack_Usage; -with Ada.Unchecked_Deallocation; --- To recover from failure of ATCB initialization +with System.Soft_Links; +-- These are procedure pointers to non-tasking routines that use task +-- specific data. In the absence of tasking, these routines refer to global +-- data. In the presense of tasking, they must be replaced with pointers to +-- task-specific versions. Also used for Create_TSD, Destroy_TSD, +-- Get_Current_Excep, Finalize_Global_List, Task_Termination, Handler. -with System.Stack_Usage; +with System.Tasking.Initialization; +pragma Elaborate_All (System.Tasking.Initialization); +-- This insures that tasking is initialized if any tasks are created package body System.Tasking.Stages is @@ -166,20 +123,20 @@ package body System.Tasking.Stages is -- This procedure must be called with abort deferred. procedure Abort_Dependents (Self_ID : Task_Id); - -- Abort all the direct dependents of Self at its current master - -- nesting level, plus all of their dependents, transitively. - -- RTS_Lock should be locked by the caller. + -- Abort all the direct dependents of Self at its current master nesting + -- level, plus all of their dependents, transitively. RTS_Lock should be + -- locked by the caller. procedure Vulnerable_Free_Task (T : Task_Id); - -- Recover all runtime system storage associated with the task T. - -- This should only be called after T has terminated and will no - -- longer be referenced. + -- Recover all runtime system storage associated with the task T. This + -- should only be called after T has terminated and will no longer be + -- referenced. -- - -- For tasks created by an allocator that fails, due to an exception, - -- it is called from Expunge_Unactivated_Tasks. + -- For tasks created by an allocator that fails, due to an exception, it is + -- called from Expunge_Unactivated_Tasks. -- - -- It is also called from Ada.Unchecked_Deallocation, for objects that - -- are or contain tasks. + -- It is also called from Ada.Unchecked_Deallocation, for objects that are + -- or contain tasks. -- -- Different code is used at master completion, in Terminate_Dependents, -- due to a need for tighter synchronization with the master. @@ -233,28 +190,27 @@ package body System.Tasking.Stages is -- Activate_Tasks -- -------------------- - -- Note that locks of activator and activated task are both locked - -- here. This is necessary because C.Common.State and - -- Self.Common.Wait_Count have to be synchronized. This is safe from - -- deadlock because the activator is always created before the activated - -- task. That satisfies our in-order-of-creation ATCB locking policy. - - -- At one point, we may also lock the parent, if the parent is - -- different from the activator. That is also consistent with the - -- lock ordering policy, since the activator cannot be created - -- before the parent. - - -- Since we are holding both the activator's lock, and Task_Wrapper - -- locks that before it does anything more than initialize the - -- low-level ATCB components, it should be safe to wait to update - -- the counts until we see that the thread creation is successful. - - -- If the thread creation fails, we do need to close the entries - -- of the task. The first phase, of dequeuing calls, only requires - -- locking the acceptor's ATCB, but the waking up of the callers - -- requires locking the caller's ATCB. We cannot safely do this - -- while we are holding other locks. Therefore, the queue-clearing - -- operation is done in a separate pass over the activation chain. + -- Note that locks of activator and activated task are both locked here. + -- This is necessary because C.Common.State and Self.Common.Wait_Count have + -- to be synchronized. This is safe from deadlock because the activator is + -- always created before the activated task. That satisfies our + -- in-order-of-creation ATCB locking policy. + + -- At one point, we may also lock the parent, if the parent is different + -- from the activator. That is also consistent with the lock ordering + -- policy, since the activator cannot be created before the parent. + + -- Since we are holding both the activator's lock, and Task_Wrapper locks + -- that before it does anything more than initialize the low-level ATCB + -- components, it should be safe to wait to update the counts until we see + -- that the thread creation is successful. + + -- If the thread creation fails, we do need to close the entries of the + -- task. The first phase, of dequeuing calls, only requires locking the + -- acceptor's ATCB, but the waking up of the callers requires locking the + -- caller's ATCB. We cannot safely do this while we are holding other + -- locks. Therefore, the queue-clearing operation is done in a separate + -- pass over the activation chain. procedure Activate_Tasks (Chain_Access : Activation_Chain_Access) is Self_ID : constant Task_Id := STPO.Self; @@ -272,8 +228,7 @@ package body System.Tasking.Stages is if System.Tasking.Detect_Blocking and then Self_ID.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; pragma Debug @@ -299,8 +254,8 @@ package body System.Tasking.Stages is All_Elaborated := False; end if; - -- Reverse the activation chain so that tasks are - -- activated in the same order they're declared. + -- Reverse the activation chain so that tasks are activated in the + -- same order they're declared. Next_C := C.Common.Activation_Link; C.Common.Activation_Link := Last_C; @@ -313,8 +268,7 @@ package body System.Tasking.Stages is if not All_Elaborated then Unlock_RTS; Initialization.Undefer_Abort_Nestable (Self_ID); - Raise_Exception - (Program_Error'Identity, "Some tasks have not been elaborated"); + raise Program_Error with "Some tasks have not been elaborated"; end if; -- Activate all the tasks in the chain. Creation of the thread of @@ -341,10 +295,10 @@ package body System.Tasking.Stages is (C.Common.Compiler_Data.Pri_Stack_Info.Size), Activate_Prio, Success); - -- There would be a race between the created task and the - -- creator to do the following initialization, if we did not - -- have a Lock/Unlock_RTS pair in the task wrapper to prevent - -- it from racing ahead. + -- There would be a race between the created task and the creator + -- to do the following initialization, if we did not have a + -- Lock/Unlock_RTS pair in the task wrapper to prevent it from + -- racing ahead. if Success then C.Common.State := Runnable; @@ -380,8 +334,8 @@ package body System.Tasking.Stages is Unlock_RTS; end if; - -- Close the entries of any tasks that failed thread creation, - -- and count those that have not finished activation. + -- Close the entries of any tasks that failed thread creation, and count + -- those that have not finished activation. Write_Lock (Self_ID); Self_ID.Common.State := Activator_Sleep; @@ -428,8 +382,7 @@ package body System.Tasking.Stages is if Self_ID.Common.Activation_Failed then Self_ID.Common.Activation_Failed := False; - Raise_Exception (Tasking_Error'Identity, - "Failure during activation"); + raise Tasking_Error with "Failure during activation"; end if; end Activate_Tasks; @@ -500,8 +453,8 @@ package body System.Tasking.Stages is -- Create_Task -- ----------------- - -- Compiler interface only. Do not call from within the RTS. - -- This must be called to create a new task. + -- Compiler interface only. Do not call from within the RTS. This must be + -- called to create a new task. procedure Create_Task (Priority : Integer; @@ -534,15 +487,13 @@ package body System.Tasking.Stages is "create task after awaiting termination"; end if; - -- If pragma Detect_Blocking is active must be checked whether - -- this potentially blocking operation is called from a - -- protected action. + -- If pragma Detect_Blocking is active must be checked whether this + -- potentially blocking operation is called from a protected action. if System.Tasking.Detect_Blocking and then Self_ID.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; pragma Debug @@ -572,19 +523,18 @@ package body System.Tasking.Stages is exception when others => Initialization.Undefer_Abort_Nestable (Self_ID); - Raise_Exception (Storage_Error'Identity, "Cannot allocate task"); + raise Storage_Error with "Cannot allocate task"; end; - -- RTS_Lock is used by Abort_Dependents and Abort_Tasks. - -- Up to this point, it is possible that we may be part of - -- a family of tasks that is being aborted. + -- RTS_Lock is used by Abort_Dependents and Abort_Tasks. Up to this + -- point, it is possible that we may be part of a family of tasks that + -- is being aborted. Lock_RTS; Write_Lock (Self_ID); - -- Now, we must check that we have not been aborted. - -- If so, we should give up on creating this task, - -- and simply return. + -- Now, we must check that we have not been aborted. If so, we should + -- give up on creating this task, and simply return. if not Self_ID.Callable then pragma Assert (Self_ID.Pending_ATC_Level = 0); @@ -610,8 +560,7 @@ package body System.Tasking.Stages is Unlock (Self_ID); Unlock_RTS; Initialization.Undefer_Abort_Nestable (Self_ID); - Raise_Exception - (Storage_Error'Identity, "Failed to initialize task"); + raise Storage_Error with "Failed to initialize task"; end if; if Master = Foreign_Task_Level + 2 then @@ -710,8 +659,8 @@ package body System.Tasking.Stages is Initialization.Defer_Abort_Nestable (Self_ID); -- ??? - -- Experimentation has shown that abort is sometimes (but not - -- always) already deferred when this is called. + -- Experimentation has shown that abort is sometimes (but not always) + -- already deferred when this is called. -- That may indicate an error. Find out what is going on @@ -749,9 +698,9 @@ package body System.Tasking.Stages is --------------------------- -- ??? - -- We have a potential problem here if finalization of global - -- objects does anything with signals or the timer server, since - -- by that time those servers have terminated. + -- We have a potential problem here if finalization of global objects does + -- anything with signals or the timer server, since by that time those + -- servers have terminated. -- It is hard to see how that would occur @@ -767,11 +716,10 @@ package body System.Tasking.Stages is begin if Self_ID.Deferral_Level = 0 then -- ??? - -- In principle, we should be able to predict whether - -- abort is already deferred here (and it should not be deferred - -- yet but in practice it seems Finalize_Global_Tasks is being - -- called sometimes, from RTS code for exceptions, with abort already - -- deferred. + -- In principle, we should be able to predict whether abort is + -- already deferred here (and it should not be deferred yet but in + -- practice it seems Finalize_Global_Tasks is being called sometimes, + -- from RTS code for exceptions, with abort already deferred. Initialization.Defer_Abort_Nestable (Self_ID); @@ -802,17 +750,17 @@ package body System.Tasking.Stages is end if; -- We need to explicitely wait for the task to be terminated here - -- because on true concurrent system, we may end this procedure - -- before the tasks are really terminated. + -- because on true concurrent system, we may end this procedure before + -- the tasks are really terminated. Write_Lock (Self_ID); loop exit when Utilities.Independent_Task_Count = 0; - -- We used to yield here, but this did not take into account - -- low priority tasks that would cause dead lock in some cases - -- (true FIFO scheduling). + -- We used to yield here, but this did not take into account low + -- priority tasks that would cause dead lock in some cases (true + -- FIFO scheduling). Timed_Sleep (Self_ID, 0.01, System.OS_Primitives.Relative, @@ -1086,9 +1034,9 @@ package body System.Tasking.Stages is Stack_Guard (Self_ID, True); - -- Initialize low-level TCB components, that cannot be initialized - -- by the creator. Enter_Task sets Self_ID.Known_Tasks_Index and - -- also Self_ID.LL.Thread + -- Initialize low-level TCB components, that cannot be initialized by + -- the creator. Enter_Task sets Self_ID.Known_Tasks_Index and also + -- Self_ID.LL.Thread Enter_Task (Self_ID); @@ -1163,7 +1111,7 @@ package body System.Tasking.Stages is Cause := Abnormal; end if; when others => - -- ??? Using an E : others here causes CD2C11A to fail on Tru64. + -- ??? Using an E : others here causes CD2C11A to fail on Tru64 Initialization.Defer_Abort_Nestable (Self_ID); @@ -1231,10 +1179,10 @@ package body System.Tasking.Stages is -- Terminate_Task -- -------------------- - -- Before we allow the thread to exit, we must clean up. This is a - -- a delicate job. We must wake up the task's master, who may immediately - -- try to deallocate the ATCB out from under the current task WHILE IT IS - -- STILL EXECUTING. + -- Before we allow the thread to exit, we must clean up. This is a a + -- delicate job. We must wake up the task's master, who may immediately try + -- to deallocate the ATCB out from under the current task WHILE IT IS STILL + -- EXECUTING. -- To avoid this, the parent task must be blocked up to the latest -- statement executed. The trouble is that we have another step that we @@ -1314,8 +1262,8 @@ package body System.Tasking.Stages is SSL.Destroy_TSD (Self_ID.Common.Compiler_Data); Initialization.Final_Task_Unlock (Self_ID); - -- WARNING: past this point, this thread must assume that the ATCB - -- has been deallocated. It should not be accessed again. + -- WARNING: past this point, this thread must assume that the ATCB has + -- been deallocated. It should not be accessed again. if Master_of_Task > 0 then STPO.Exit_Task; @@ -1440,9 +1388,9 @@ package body System.Tasking.Stages is Unlock (Self_ID); Unlock (Activator); - -- After the activation, active priority should be the same - -- as base priority. We must unlock the Activator first, - -- though, since it should not wait if we have lower priority. + -- After the activation, active priority should be the same as base + -- priority. We must unlock the Activator first, though, since it + -- should not wait if we have lower priority. if Get_Priority (Self_ID) /= Self_ID.Common.Base_Priority then Write_Lock (Self_ID); @@ -1523,12 +1471,12 @@ package body System.Tasking.Stages is (Self_ID.Deferral_Level > 0 or else not System.Restrictions.Abort_Allowed); - -- Count how many active dependent tasks this master currently - -- has, and record this in Wait_Count. + -- Count how many active dependent tasks this master currently has, and + -- record this in Wait_Count. - -- This count should start at zero, since it is initialized to - -- zero for new tasks, and the task should not exit the - -- sleep-loops that use this count until the count reaches zero. + -- This count should start at zero, since it is initialized to zero for + -- new tasks, and the task should not exit the sleep-loops that use this + -- count until the count reaches zero. -- While we're counting, if we run across any unactivated tasks that -- belong to this master, we summarily terminate them as required by @@ -1543,6 +1491,7 @@ package body System.Tasking.Stages is -- Terminate unactivated (never-to-be activated) tasks if C.Common.Activator = Self_ID and then C.Master_of_Task = CM then + pragma Assert (C.Common.State = Unactivated); -- Usually, C.Common.Activator = Self_ID implies C.Master_of_Task -- = CM. The only case where C is pending activation by this @@ -1581,9 +1530,8 @@ package body System.Tasking.Stages is -- Wait until dependent tasks are all terminated or ready to terminate. -- While waiting, the task may be awakened if the task's priority needs - -- changing, or this master is aborted. In the latter case, we want - -- to abort the dependents, and resume waiting until Wait_Count goes - -- to zero. + -- changing, or this master is aborted. In the latter case, we abort the + -- dependents, and resume waiting until Wait_Count goes to zero. Write_Lock (Self_ID); @@ -1612,9 +1560,8 @@ package body System.Tasking.Stages is Self_ID.Common.State := Runnable; Unlock (Self_ID); - -- Dependents are all terminated or on terminate alternatives. - -- Now, force those on terminate alternatives to terminate, by - -- aborting them. + -- Dependents are all terminated or on terminate alternatives. Now, + -- force those on terminate alternatives to terminate, by aborting them. pragma Assert (Check_Unactivated_Tasks); @@ -1644,14 +1591,14 @@ package body System.Tasking.Stages is -- rules prevent us from doing that without releasing the locks on C -- and Self_ID. Releasing and retaking those locks would be wasteful -- at best, and should not be considered further without more - -- detailed analysis of potential concurrent accesses to the - -- ATCBs of C and Self_ID. + -- detailed analysis of potential concurrent accesses to the ATCBs + -- of C and Self_ID. - -- Count how many "alive" dependent tasks this master currently - -- has, and record this in Wait_Count. This count should start at - -- zero, since it is initialized to zero for new tasks, and the - -- task should not exit the sleep-loops that use this count until - -- the count reaches zero. + -- Count how many "alive" dependent tasks this master currently has, + -- and record this in Wait_Count. This count should start at zero, + -- since it is initialized to zero for new tasks, and the task should + -- not exit the sleep-loops that use this count until the count + -- reaches zero. pragma Assert (Self_ID.Common.Wait_Count = 0); @@ -1699,10 +1646,10 @@ package body System.Tasking.Stages is -- fast as we can, so there is no point. -- Remove terminated tasks from the list of Self_ID's dependents, but - -- don't free their ATCBs yet, because of lock order restrictions, - -- which don't allow us to call "free" or "malloc" while holding any - -- other locks. Instead, we put those ATCBs to be freed onto a - -- temporary list, called To_Be_Freed. + -- don't free their ATCBs yet, because of lock order restrictions, which + -- don't allow us to call "free" or "malloc" while holding any other + -- locks. Instead, we put those ATCBs to be freed onto a temporary list, + -- called To_Be_Freed. if not Single_Lock then Lock_RTS; @@ -1747,13 +1694,12 @@ package body System.Tasking.Stages is -- ??? -- The check "T.Common.Parent /= null ..." below is to prevent dangling - -- references to terminated library-level tasks, which could - -- otherwise occur during finalization of library-level objects. - -- A better solution might be to hook task objects into the - -- finalization chain and deallocate the ATCB when the task - -- object is deallocated. However, this change is not likely - -- to gain anything significant, since all this storage should - -- be recovered en-masse when the process exits. + -- references to terminated library-level tasks, which could otherwise + -- occur during finalization of library-level objects. A better solution + -- might be to hook task objects into the finalization chain and + -- deallocate the ATCB when the task object is deallocated. However, + -- this change is not likely to gain anything significant, since all + -- this storage should be recovered en-masse when the process exits. while To_Be_Freed /= null loop T := To_Be_Freed; @@ -1803,6 +1749,7 @@ package body System.Tasking.Stages is -- ATCB. That would not cover the case of unactivated tasks. It also -- would force us to keep the underlying thread around past termination, -- since references to the ATCB are possible past termination. + -- Currently, we get rid of the thread as soon as the task terminates, -- and let the parent recover the ATCB later. @@ -1812,9 +1759,8 @@ package body System.Tasking.Stages is -- that no longer have ATCBs. It is not clear how much this would gain, -- since the user-level task object would still be occupying storage. - -- Make next master level up active. - -- We don't need to lock the ATCB, since the value is only updated by - -- each task for itself. + -- Make next master level up active. We don't need to lock the ATCB, + -- since the value is only updated by each task for itself. Self_ID.Master_Within := CM - 1; end Vulnerable_Complete_Master; @@ -1876,9 +1822,8 @@ package body System.Tasking.Stages is Unlock_RTS; end if; - -- If Self_ID.Master_Within = Self_ID.Master_of_Task + 2 - -- we may have dependent tasks for which we need to wait. - -- Otherwise, we can just exit. + -- If Self_ID.Master_Within = Self_ID.Master_of_Task + 2 we may have + -- dependent tasks for which we need to wait. Otherwise we just exit. if Self_ID.Master_Within = Self_ID.Master_of_Task + 2 then Vulnerable_Complete_Master (Self_ID); @@ -1889,17 +1834,17 @@ package body System.Tasking.Stages is -- Vulnerable_Free_Task -- -------------------------- - -- Recover all runtime system storage associated with the task T. - -- This should only be called after T has terminated and will no - -- longer be referenced. + -- Recover all runtime system storage associated with the task T. This + -- should only be called after T has terminated and will no longer be + -- referenced. - -- For tasks created by an allocator that fails, due to an exception, - -- it is called from Expunge_Unactivated_Tasks. + -- For tasks created by an allocator that fails, due to an exception, it + -- is called from Expunge_Unactivated_Tasks. - -- For tasks created by elaboration of task object declarations it - -- is called from the finalization code of the Task_Wrapper procedure. - -- It is also called from Ada.Unchecked_Deallocation, for objects that - -- are or contain tasks. + -- For tasks created by elaboration of task object declarations it is + -- called from the finalization code of the Task_Wrapper procedure. It is + -- also called from Ada.Unchecked_Deallocation, for objects that are or + -- contain tasks. procedure Vulnerable_Free_Task (T : Task_Id) is begin diff --git a/gcc/ada/s-tassta.ads b/gcc/ada/s-tassta.ads index 03abca42d8b..e96e2d906e7 100644 --- a/gcc/ada/s-tassta.ads +++ b/gcc/ada/s-tassta.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,14 +37,12 @@ -- Note: Only the compiler is allowed to use this interface, by generating -- direct calls to it, via Rtsfind. + -- Any changes to this interface may require corresponding compiler changes -- in exp_ch9.adb and possibly exp_ch7.adb with System.Task_Info; --- used for Task_Info_Type - with System.Parameters; --- used for Size_Type package System.Tasking.Stages is pragma Elaborate_Body; diff --git a/gcc/ada/s-tasuti.adb b/gcc/ada/s-tasuti.adb index 6767f29c9e5..0706444b480 100644 --- a/gcc/ada/s-tasuti.adb +++ b/gcc/ada/s-tasuti.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,39 +31,20 @@ -- -- ------------------------------------------------------------------------------ --- This package provides RTS Internal Declarations. +-- This package provides RTS Internal Declarations + -- These declarations are not part of the GNARLI pragma Polling (Off); --- Turn off polling, we do not want ATC polling to take place during --- tasking operations. It causes infinite loops and other problems. +-- Turn off polling, we do not want ATC polling to take place during tasking +-- operations. It causes infinite loops and other problems. with System.Tasking.Debug; --- used for Known_Tasks - with System.Task_Primitives.Operations; --- used for Write_Lock --- Wakeup --- Unlock --- Sleep --- Abort_Task --- Lock/Unlock_RTS - with System.Tasking.Initialization; --- Used for Defer_Abort --- Undefer_Abort --- Locked_Abort_To_Level - with System.Tasking.Queuing; --- used for Dequeue_Call --- Dequeue_Head - with System.Parameters; --- used for Single_Lock --- Runtime_Traces - with System.Traces.Tasking; --- used for Send_Trace_Info package body System.Tasking.Utilities is @@ -129,8 +110,7 @@ package body System.Tasking.Utilities is if System.Tasking.Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; Initialization.Defer_Abort_Nestable (Self_Id); diff --git a/gcc/ada/s-tataat.adb b/gcc/ada/s-tataat.adb index 1c672769e7f..695f5164ecd 100644 --- a/gcc/ada/s-tataat.adb +++ b/gcc/ada/s-tataat.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,16 +32,10 @@ -- -- ------------------------------------------------------------------------------ -with System.Task_Primitives.Operations; --- used for Write_Lock --- Unlock --- Lock/Unlock_RTS +with Ada.Unchecked_Conversion; +with System.Task_Primitives.Operations; with System.Tasking.Initialization; --- used for Defer_Abort --- Undefer_Abort - -with Ada.Unchecked_Conversion; package body System.Tasking.Task_Attributes is diff --git a/gcc/ada/s-tataat.ads b/gcc/ada/s-tataat.ads index bcf3f0d4c18..43608af448b 100644 --- a/gcc/ada/s-tataat.ads +++ b/gcc/ada/s-tataat.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2007, AdaCore -- +-- Copyright (C) 1995-2008, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,10 +35,8 @@ -- This package provides support for the body of Ada.Task_Attributes with Ada.Finalization; --- Used for Limited_Controlled with System.Storage_Elements; --- Used for Integer_Address package System.Tasking.Task_Attributes is diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb index b3efad52af1..fd8a16814e8 100644 --- a/gcc/ada/s-tpoben.adb +++ b/gcc/ada/s-tpoben.adb @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- E N T R I E S -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.ENTRIES -- -- -- --- B o d y -- +-- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -44,32 +43,13 @@ -- Note: the compiler generates direct calls to this interface, via Rtsfind -with Ada.Exceptions; --- Used for Exception_Occurrence_Access --- Raise_Exception - with System.Task_Primitives.Operations; --- Used for Initialize_Lock --- Write_Lock --- Unlock --- Get_Priority --- Wakeup --- Set_Ceiling +with System.Restrictions; +with System.Parameters; with System.Tasking.Initialization; --- Used for Defer_Abort, --- Undefer_Abort, --- Change_Base_Priority - pragma Elaborate_All (System.Tasking.Initialization); --- This insures that tasking is initialized if any protected objects are --- created. - -with System.Restrictions; --- Used for Abort_Allowed - -with System.Parameters; --- Used for Single_Lock +-- To insure that tasking is initialized if any protected objects are created package body System.Tasking.Protected_Objects.Entries is @@ -77,7 +57,6 @@ package body System.Tasking.Protected_Objects.Entries is use Parameters; use Task_Primitives.Operations; - use Ada.Exceptions; ---------------- -- Local Data -- @@ -126,7 +105,7 @@ package body System.Tasking.Protected_Objects.Entries is STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation); if Ceiling_Violation then - Raise_Exception (Program_Error'Identity, "Ceiling Violation"); + raise Program_Error with "Ceiling Violation"; end if; if Single_Lock then @@ -246,8 +225,7 @@ package body System.Tasking.Protected_Objects.Entries is is begin if Object.Finalized then - Raise_Exception - (Program_Error'Identity, "Protected Object is finalized"); + raise Program_Error with "Protected Object is finalized"; end if; -- If pragma Detect_Blocking is active then, as described in the ARM @@ -306,7 +284,7 @@ package body System.Tasking.Protected_Objects.Entries is Lock_Entries (Object, Ceiling_Violation); if Ceiling_Violation then - Raise_Exception (Program_Error'Identity, "Ceiling Violation"); + raise Program_Error with "Ceiling Violation"; end if; end Lock_Entries; @@ -319,8 +297,7 @@ package body System.Tasking.Protected_Objects.Entries is begin if Object.Finalized then - Raise_Exception - (Program_Error'Identity, "Protected Object is finalized"); + raise Program_Error with "Protected Object is finalized"; end if; -- If pragma Detect_Blocking is active then, as described in the ARM @@ -345,7 +322,7 @@ package body System.Tasking.Protected_Objects.Entries is Read_Lock (Object.L'Access, Ceiling_Violation); if Ceiling_Violation then - Raise_Exception (Program_Error'Identity, "Ceiling Violation"); + raise Program_Error with "Ceiling Violation"; end if; -- We are entering in a protected action, so that we increase the diff --git a/gcc/ada/s-tpoben.ads b/gcc/ada/s-tpoben.ads index d1cc4e7d6f3..afbdc6bac0d 100644 --- a/gcc/ada/s-tpoben.ads +++ b/gcc/ada/s-tpoben.ads @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- E N T R I E S -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.ENTRIES -- -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,11 +31,13 @@ -- -- ------------------------------------------------------------------------------ --- This package contains all the simple primitives related to --- Protected_Objects with entries (i.e init, lock, unlock). +-- This package contains all simple primitives related to Protected_Objects +-- with entries (i.e init, lock, unlock). + -- The handling of protected objects with no entries is done in -- System.Tasking.Protected_Objects, the complex routines for protected -- objects with entries in System.Tasking.Protected_Objects.Operations. + -- The split between Entries and Operations is needed to break circular -- dependencies inside the run time. @@ -44,8 +45,6 @@ -- Any changes to this interface may require corresponding compiler changes. with Ada.Finalization; --- used for Limited_Controlled - with Ada.Unchecked_Conversion; package System.Tasking.Protected_Objects.Entries is diff --git a/gcc/ada/s-tpobop.adb b/gcc/ada/s-tpobop.adb index f034f9e63a5..7ff99e5e34d 100644 --- a/gcc/ada/s-tpobop.adb +++ b/gcc/ada/s-tpobop.adb @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- O P E R A T I O N S -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.OPERATIONS -- -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,8 +31,8 @@ -- -- ------------------------------------------------------------------------------ --- This package contains all the extended primitives related to --- Protected_Objects with entries. +-- This package contains all extended primitives related to Protected_Objects +-- with entries. -- The handling of protected objects with no entries is done in -- System.Tasking.Protected_Objects, the simple routines for protected @@ -46,51 +45,18 @@ -- Note: the compiler generates direct calls to this interface, via Rtsfind. with System.Task_Primitives.Operations; --- used for Initialize_Lock --- Write_Lock --- Unlock --- Get_Priority --- Wakeup - with System.Tasking.Entry_Calls; --- used for Wait_For_Completion --- Wait_Until_Abortable --- Wait_For_Completion_With_Timeout - -with System.Tasking.Initialization; --- Used for Defer_Abort, --- Undefer_Abort, --- Change_Base_Priority - -pragma Elaborate_All (System.Tasking.Initialization); --- This insures that tasking is initialized if any protected objects are --- created. - with System.Tasking.Queuing; --- used for Enqueue --- Broadcast_Program_Error --- Select_Protected_Entry_Call --- Onqueue --- Count_Waiting - with System.Tasking.Rendezvous; --- used for Task_Do_Or_Queue - with System.Tasking.Utilities; --- used for Exit_One_ATC_Level - with System.Tasking.Debug; --- used for Trace - with System.Parameters; --- used for Single_Lock --- Runtime_Traces - with System.Traces.Tasking; --- used for Send_Trace_Info - with System.Restrictions; --- used for Run_Time_Restrictions + +with System.Tasking.Initialization; +pragma Elaborate_All (System.Tasking.Initialization); +-- Insures that tasking is initialized if any protected objects are created package body System.Tasking.Protected_Objects.Operations is @@ -580,8 +546,7 @@ package body System.Tasking.Protected_Objects.Operations is end if; if Self_ID.ATC_Nesting_Level = ATC_Level'Last then - Raise_Exception - (Storage_Error'Identity, "not enough ATC nesting levels"); + raise Storage_Error with "not enough ATC nesting levels"; end if; -- If pragma Detect_Blocking is active then Program_Error must be @@ -591,8 +556,7 @@ package body System.Tasking.Protected_Objects.Operations is if Detect_Blocking and then Self_ID.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; -- Self_ID.Deferral_Level should be 0, except when called from Finalize, @@ -981,8 +945,7 @@ package body System.Tasking.Protected_Objects.Operations is begin if Self_Id.ATC_Nesting_Level = ATC_Level'Last then - Raise_Exception (Storage_Error'Identity, - "not enough ATC nesting levels"); + raise Storage_Error with "not enough ATC nesting levels"; end if; -- If pragma Detect_Blocking is active then Program_Error must be @@ -992,8 +955,7 @@ package body System.Tasking.Protected_Objects.Operations is if Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; if Runtime_Traces then diff --git a/gcc/ada/s-tpobop.ads b/gcc/ada/s-tpobop.ads index 0316e0c6564..8620c796f43 100644 --- a/gcc/ada/s-tpobop.ads +++ b/gcc/ada/s-tpobop.ads @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- O P E R A T I O N S -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.OPERATIONS -- -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -45,7 +44,6 @@ -- Any changes to this interface may require corresponding compiler changes. with Ada.Exceptions; --- Used for Exception_Id with System.Tasking.Protected_Objects.Entries; diff --git a/gcc/ada/s-tposen.adb b/gcc/ada/s-tposen.adb index aeee03684b4..cfa7d3a7e7e 100644 --- a/gcc/ada/s-tposen.adb +++ b/gcc/ada/s-tposen.adb @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- S I N G L E _ E N T R Y -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.SINGLE_ENTRY -- -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,8 +32,8 @@ ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); --- Turn off subprogram ordering check, since restricted GNARLI --- subprograms are gathered together at end. +-- Turn off subprogram ordering check, since restricted GNARLI subprograms are +-- gathered together at end. -- This package provides an optimized version of Protected_Objects.Operations -- and Protected_Objects.Entries making the following assumptions: @@ -60,19 +59,12 @@ pragma Polling (Off); -- operations. It can cause infinite loops and other problems. pragma Suppress (All_Checks); - -with System.Task_Primitives.Operations; --- used for Self --- Finalize_Lock --- Write_Lock --- Unlock +-- Why is this required ??? with Ada.Exceptions; --- used for Exception_Id --- Raise_Exception +with System.Task_Primitives.Operations; with System.Parameters; --- used for Single_Lock package body System.Tasking.Protected_Objects.Single_Entry is @@ -155,7 +147,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is use type Ada.Exceptions.Exception_Id; E : constant Ada.Exceptions.Exception_Id := - Entry_Call.Exception_To_Raise; + Entry_Call.Exception_To_Raise; begin if E /= Ada.Exceptions.Null_Id then @@ -560,8 +552,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is if Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; Lock_Entry (Object); @@ -686,8 +677,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is if Detect_Blocking and then Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); + raise Program_Error with "potentially blocking operation"; end if; STPO.Write_Lock (Object.L'Access, Ceiling_Violation); diff --git a/gcc/ada/s-tposen.ads b/gcc/ada/s-tposen.ads index 074ee71e410..f8bf9114409 100644 --- a/gcc/ada/s-tposen.ads +++ b/gcc/ada/s-tposen.ads @@ -2,12 +2,11 @@ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- --- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- --- S I N G L E _ E N T R Y -- +-- SYSTEM.TASKING.PROTECTED_OBJECTS.SINGLE_ENTRY -- -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -35,13 +34,13 @@ -- This package provides an optimized version of Protected_Objects.Operations -- and Protected_Objects.Entries making the following assumptions: -- --- PO have only one entry --- There is only one caller at a time (No_Entry_Queue) --- There is no dynamic priority support (No_Dynamic_Priorities) --- No Abort Statements --- (No_Abort_Statements, Max_Asynchronous_Select_Nesting => 0) --- PO are at library level --- None of the tasks will terminate (no need for finalization) +-- PO have only one entry +-- There is only one caller at a time (No_Entry_Queue) +-- There is no dynamic priority support (No_Dynamic_Priorities) +-- No Abort Statements +-- (No_Abort_Statements, Max_Asynchronous_Select_Nesting => 0) +-- PO are at library level +-- None of the tasks will terminate (no need for finalization) -- -- This interface is intended to be used in the ravenscar profile, the -- compiler is responsible for ensuring that the conditions mentioned above @@ -268,7 +267,7 @@ package System.Tasking.Protected_Objects.Single_Entry is function Protected_Count_Entry (Object : Protection_Entry) return Natural; - -- Return the number of entry calls on Object (0 or 1). + -- Return the number of entry calls on Object (0 or 1) function Protected_Single_Entry_Caller (Object : Protection_Entry) return Task_Id; diff --git a/gcc/ada/s-traces.ads b/gcc/ada/s-traces.ads index 2c6d00984b3..c42cc516820 100644 --- a/gcc/ada/s-traces.ads +++ b/gcc/ada/s-traces.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,7 +43,7 @@ -- with the event. Thid procedure is used from within the Runtime to send -- debug informations. --- This primitive is overloaded in System.Traces.Tasking and this package. +-- This primitive is overloaded in System.Traces.Tasking and this package -- Send_Trace_Info calls Send_Trace, in System.Traces.Send, which is trarget -- dependent, to send the debug informations to a debugger, stream .. @@ -52,17 +52,17 @@ -- corresponding Send_Trace_Info procedure. It may be required for some -- target to modify Send_Trace (eg. VxWorks). --- To add a new target, just adapt System.Traces.Send to your own purpose. +-- To add a new target, just adapt System.Traces.Send to your own purposes package System.Traces is pragma Preelaborate; type Trace_T is ( - -- Events handled. + -- Events handled -- Messages - -- + M_Accept_Complete, M_Select_Else, M_RDV_Complete, @@ -70,13 +70,13 @@ package System.Traces is M_Delay, -- Errors - -- + E_Missed, E_Timeout, E_Kill, -- Waiting events - -- + W_Call, W_Accept, W_Select, @@ -89,7 +89,7 @@ package System.Traces is WT_Completion, -- Protected objects events - -- + PO_Call, POT_Call, PO_Run, @@ -98,7 +98,7 @@ package System.Traces is PO_Done, -- Task handling events - -- + T_Create, T_Activate, T_Abort, diff --git a/gcc/ada/s-trafor-default.ads b/gcc/ada/s-trafor-default.ads index 01d957f37bb..182ade1ba94 100644 --- a/gcc/ada/s-trafor-default.ads +++ b/gcc/ada/s-trafor-default.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,7 +37,7 @@ package System.Traces.Format is pragma Preelaborate; Max_Size : constant Integer := 128; - -- Event messages' maximum size. + -- Maximum size if event messages subtype String_Trace is String (1 .. Max_Size); -- Specific type in which trace information is stored. An ASCII.NUL diff --git a/gcc/ada/s-valrea.adb b/gcc/ada/s-valrea.adb index 60f48739dab..ead49f80649 100644 --- a/gcc/ada/s-valrea.adb +++ b/gcc/ada/s-valrea.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -56,7 +56,7 @@ package body System.Val_Real is P : Integer; -- Local copy of string pointer - Base : Long_Long_Float; + Base : Long_Long_Float; -- Base value Uval : Long_Long_Float; diff --git a/gcc/ada/s-valuti.adb b/gcc/ada/s-valuti.adb index f2ed3217e2b..50be73acd9f 100644 --- a/gcc/ada/s-valuti.adb +++ b/gcc/ada/s-valuti.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -72,7 +72,6 @@ package body System.Val_Util is S (J) := To_Upper (S (J)); end loop; end if; - end Normalize_String; ------------------- @@ -156,7 +155,6 @@ package body System.Val_Util is Ptr.all := P; return X; - end Scan_Exponent; -------------------- diff --git a/gcc/ada/s-vmexta.ads b/gcc/ada/s-vmexta.ads index 82b12b3440a..73da95d30d8 100644 --- a/gcc/ada/s-vmexta.ads +++ b/gcc/ada/s-vmexta.ads @@ -51,7 +51,7 @@ package System.VMS_Exception_Table is private function Base_Code_In (Code : SSL.Exception_Code) return SSL.Exception_Code; - -- Value of Code with the severity bits masked off. + -- Value of Code with the severity bits masked off function Coded_Exception (X : SSL.Exception_Code) return SSL.Exception_Data_Ptr; diff --git a/gcc/ada/s-vxwork-arm.ads b/gcc/ada/s-vxwork-arm.ads index 008e04cf9b1..b3908d952d3 100644 --- a/gcc/ada/s-vxwork-arm.ads +++ b/gcc/ada/s-vxwork-arm.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,14 +31,14 @@ -- -- ------------------------------------------------------------------------------ --- This is the ARM VxWorks version of this package. +-- This is the ARM VxWorks version of this package package System.VxWorks is pragma Preelaborate (System.VxWorks); -- Floating point context record. ARM version - -- The record definition below matches what arch/arm/fppArmLib.h says. + -- The record definition below matches what arch/arm/fppArmLib.h says type FP_CONTEXT is record Dummy : Integer; @@ -48,6 +48,6 @@ package System.VxWorks is pragma Convention (C, FP_CONTEXT); Num_HW_Interrupts : constant := 256; - -- Number of entries in hardware interrupt vector table. + -- Number of entries in hardware interrupt vector table end System.VxWorks; diff --git a/gcc/ada/s-vxwork-m68k.ads b/gcc/ada/s-vxwork-m68k.ads index f2b77edb0cc..a0091e4a11c 100644 --- a/gcc/ada/s-vxwork-m68k.ads +++ b/gcc/ada/s-vxwork-m68k.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is the M68K VxWorks version of this package. +-- This is the M68K VxWorks version of this package with Interfaces.C; diff --git a/gcc/ada/s-vxwork-mips.ads b/gcc/ada/s-vxwork-mips.ads index 03290454254..d57bffe1966 100644 --- a/gcc/ada/s-vxwork-mips.ads +++ b/gcc/ada/s-vxwork-mips.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is the MIPS VxWorks version of this package. +-- This is the MIPS VxWorks version of this package with Interfaces.C; @@ -52,6 +52,6 @@ package System.VxWorks is pragma Convention (C, FP_CONTEXT); Num_HW_Interrupts : constant := 256; - -- Number of entries in hardware interrupt vector table. + -- Number of entries in hardware interrupt vector table end System.VxWorks; diff --git a/gcc/ada/s-vxwork-ppc.ads b/gcc/ada/s-vxwork-ppc.ads index 62116ca113c..927b8502a76 100644 --- a/gcc/ada/s-vxwork-ppc.ads +++ b/gcc/ada/s-vxwork-ppc.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is the PPC VxWorks version of this package. +-- This is the PPC VxWorks version of this package with Interfaces.C; diff --git a/gcc/ada/s-vxwork-sparcv9.ads b/gcc/ada/s-vxwork-sparcv9.ads index b769b2a7a97..9a6200b6db8 100644 --- a/gcc/ada/s-vxwork-sparcv9.ads +++ b/gcc/ada/s-vxwork-sparcv9.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1998-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is the Sparc64 VxWorks version of this package. +-- This is the Sparc64 VxWorks version of this package with Interfaces; @@ -57,6 +57,6 @@ package System.VxWorks is pragma Convention (C, FP_CONTEXT); Num_HW_Interrupts : constant := 256; - -- Number of entries in hardware interrupt vector table. + -- Number of entries in hardware interrupt vector table end System.VxWorks; diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb index d4e7bd387d9..6efbc9f5b28 100644 --- a/gcc/ada/scn.adb +++ b/gcc/ada/scn.adb @@ -292,11 +292,15 @@ package body Scn is Upper_Half_Encoding := True; when UTF16_LE | UTF16_BE => + Set_Standard_Error; Write_Line ("UTF-16 encoding format not recognized"); + Set_Standard_Output; raise Unrecoverable_Error; when UTF32_LE | UTF32_BE => + Set_Standard_Error; Write_Line ("UTF-32 encoding format not recognized"); + Set_Standard_Output; raise Unrecoverable_Error; when Unknown => diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index f6ae6e56276..33c12941aa2 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1402,8 +1402,7 @@ package body Sem_Aggr is if Is_Character_Type (Component_Typ) and then No (Next_Index (Nxt_Ind)) - and then (Nkind (Expr) = N_String_Literal - or else Nkind (Expr) = N_Operator_Symbol) + and then Nkind_In (Expr, N_String_Literal, N_Operator_Symbol) then -- A string literal used in a multidimensional array -- aggregate in place of the final one-dimensional @@ -1513,9 +1512,8 @@ package body Sem_Aggr is if Ada_Version = Ada_83 and then Assoc /= First (Component_Associations (N)) - and then (Nkind (Parent (N)) = N_Assignment_Statement - or else - Nkind (Parent (N)) = N_Object_Declaration) + and then Nkind_In (Parent (N), N_Assignment_Statement, + N_Object_Declaration) then Error_Msg_N ("(Ada 83) illegal context for OTHERS choice", N); @@ -2484,14 +2482,11 @@ package body Sem_Aggr is function Has_Expansion_Delayed (Expr : Node_Id) return Boolean is Kind : constant Node_Kind := Nkind (Expr); - begin - return ((Kind = N_Aggregate - or else Kind = N_Extension_Aggregate) + return (Nkind_In (Kind, N_Aggregate, N_Extension_Aggregate) and then Present (Etype (Expr)) and then Is_Record_Type (Etype (Expr)) and then Expansion_Delayed (Expr)) - or else (Kind = N_Qualified_Expression and then Has_Expansion_Delayed (Expression (Expr))); end Has_Expansion_Delayed; @@ -2848,8 +2843,8 @@ package body Sem_Aggr is else Root_Typ := Root_Type (Typ); - if Nkind (Parent (Base_Type (Root_Typ))) - = N_Private_Type_Declaration + if Nkind (Parent (Base_Type (Root_Typ))) = + N_Private_Type_Declaration then Error_Msg_NE ("type of aggregate has private ancestor&!", diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 8fc203333a9..114df98d073 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -35,6 +35,7 @@ with Exp_Dist; use Exp_Dist; with Exp_Util; use Exp_Util; with Expander; use Expander; with Freeze; use Freeze; +with Itypes; use Itypes; with Lib; use Lib; with Lib.Xref; use Lib.Xref; with Nlists; use Nlists; @@ -447,18 +448,41 @@ package body Sem_Attr is -- subprogram itself as the designated type. Type-checking in -- this case compares the signatures of the designated types. + -- Note: This fragment of the tree is temporarily malformed + -- because the correct tree requires an E_Subprogram_Type entity + -- as the designated type. In most cases this designated type is + -- later overriden by the semantics with the type imposed by the + -- context during the resolution phase. In the specific case of + -- the expression Address!(Prim'Unrestricted_Access), used to + -- initialize slots of dispatch tables, this work will be done by + -- the expander (see Exp_Aggr). + + -- The reason to temporarily add this kind of node to the tree + -- instead of a proper E_Subprogram_Type itype, is the following: + -- in case of errors found in the source file we report better + -- error messages. For example, instead of generating the + -- following error: + + -- "expected access to subprogram with profile + -- defined at line X" + + -- we currently generate: + + -- "expected access to function Z defined at line X" + Set_Etype (N, Any_Type); if not Is_Overloaded (P) then Check_Local_Access (Entity (P)); if not Is_Intrinsic_Subprogram (Entity (P)) then - Acc_Type := - New_Internal_Entity - (Get_Kind (Entity (P)), Current_Scope, Loc, 'A'); + Acc_Type := Create_Itype (Get_Kind (Entity (P)), N); + Set_Is_Public (Acc_Type, False); Set_Etype (Acc_Type, Acc_Type); + Set_Convention (Acc_Type, Convention (Entity (P))); Set_Directly_Designated_Type (Acc_Type, Entity (P)); Set_Etype (N, Acc_Type); + Freeze_Before (N, Acc_Type); end if; else @@ -467,12 +491,13 @@ package body Sem_Attr is Check_Local_Access (It.Nam); if not Is_Intrinsic_Subprogram (It.Nam) then - Acc_Type := - New_Internal_Entity - (Get_Kind (It.Nam), Current_Scope, Loc, 'A'); + Acc_Type := Create_Itype (Get_Kind (It.Nam), N); + Set_Is_Public (Acc_Type, False); Set_Etype (Acc_Type, Acc_Type); + Set_Convention (Acc_Type, Convention (It.Nam)); Set_Directly_Designated_Type (Acc_Type, It.Nam); Add_One_Interp (N, Acc_Type, Acc_Type); + Freeze_Before (N, Acc_Type); end if; Get_Next_Interp (Index, It); @@ -502,9 +527,7 @@ package body Sem_Attr is (Nkind (Par) = N_Component_Association or else Nkind (Par) in N_Subexpr) loop - if Nkind (Par) = N_Aggregate - or else Nkind (Par) = N_Extension_Aggregate - then + if Nkind_In (Par, N_Aggregate, N_Extension_Aggregate) then if Etype (Par) = Typ then Set_Has_Self_Reference (Par); return True; @@ -552,7 +575,23 @@ package body Sem_Attr is -- could modify local variables to be passed out of scope if Aname = Name_Unrestricted_Access then - Kill_Current_Values; + + -- Do not kill values on nodes initializing dispatch tables + -- slots. The construct Address!(Prim'Unrestricted_Access) + -- is currently generated by the expander only for this + -- purpose. Done to keep the quality of warnings currently + -- generated by the compiler (otherwise any declaration of + -- a tagged type cleans constant indications from its scope). + + if Nkind (Parent (N)) = N_Unchecked_Type_Conversion + and then Etype (Parent (N)) = RTE (RE_Address) + and then Is_Dispatching_Operation + (Directly_Designated_Type (Etype (N))) + then + null; + else + Kill_Current_Values; + end if; end if; return; @@ -626,10 +665,9 @@ package body Sem_Attr is if not In_Default_Expression and then not Has_Completion (Scop) - and then - Nkind (Parent (N)) /= N_Discriminant_Association - and then - Nkind (Parent (N)) /= N_Index_Or_Discriminant_Constraint + and then not + Nkind_In (Parent (N), N_Discriminant_Association, + N_Index_Or_Discriminant_Constraint) then Error_Msg_N ("current instance attribute must appear alone", N); @@ -726,8 +764,8 @@ package body Sem_Attr is Kill_Current_Values (Ent); exit; - elsif Nkind (PP) = N_Selected_Component - or else Nkind (PP) = N_Indexed_Component + elsif Nkind_In (PP, N_Selected_Component, + N_Indexed_Component) then PP := Prefix (PP); @@ -1414,8 +1452,8 @@ package body Sem_Attr is null; elsif Is_List_Member (N) - and then Nkind (Parent (N)) /= N_Procedure_Call_Statement - and then Nkind (Parent (N)) /= N_Aggregate + and then not Nkind_In (Parent (N), N_Procedure_Call_Statement, + N_Aggregate) then null; @@ -2145,9 +2183,7 @@ package body Sem_Attr is -- or of a variable of the enclosing task type. else - if Nkind (Pref) = N_Identifier - or else Nkind (Pref) = N_Expanded_Name - then + if Nkind_In (Pref, N_Identifier, N_Expanded_Name) then Ent := Entity (Pref); if not OK_Entry (Ent) @@ -2297,9 +2333,7 @@ package body Sem_Attr is begin Check_E0; - if Nkind (P) = N_Identifier - or else Nkind (P) = N_Expanded_Name - then + if Nkind_In (P, N_Identifier, N_Expanded_Name) then Ent := Entity (P); if not Is_Entry (Ent) then @@ -2500,9 +2534,7 @@ package body Sem_Attr is begin Check_E0; - if Nkind (P) = N_Identifier - or else Nkind (P) = N_Expanded_Name - then + if Nkind_In (P, N_Identifier, N_Expanded_Name) then Ent := Entity (P); if Ekind (Ent) /= E_Entry then @@ -2623,7 +2655,6 @@ package body Sem_Attr is when Attribute_Default_Bit_Order => Default_Bit_Order : begin Check_Standard_Prefix; - Check_E0; if Bytes_Big_Endian then Rewrite (N, @@ -2733,7 +2764,6 @@ package body Sem_Attr is if Nkind (P) /= N_Identifier then Error_Msg_N ("identifier expected (check name)", P); - elsif Get_Check_Id (Chars (P)) = No_Check_Id then Error_Msg_N ("& is not a recognized check name", P); end if; @@ -2802,7 +2832,6 @@ package body Sem_Attr is --------------- when Attribute_Fast_Math => - Check_E0; Check_Standard_Prefix; if Opt.Fast_Math then @@ -3320,9 +3349,8 @@ package body Sem_Attr is -- Case of attribute used as actual for subprogram (positional) - elsif (Nkind (Parnt) = N_Procedure_Call_Statement - or else - Nkind (Parnt) = N_Function_Call) + elsif Nkind_In (Parnt, N_Procedure_Call_Statement, + N_Function_Call) and then Is_Entity_Name (Name (Parnt)) then Must_Be_Imported (Entity (Name (Parnt))); @@ -3330,9 +3358,8 @@ package body Sem_Attr is -- Case of attribute used as actual for subprogram (named) elsif Nkind (Parnt) = N_Parameter_Association - and then (Nkind (GParnt) = N_Procedure_Call_Statement - or else - Nkind (GParnt) = N_Function_Call) + and then Nkind_In (GParnt, N_Procedure_Call_Statement, + N_Function_Call) and then Is_Entity_Name (Name (GParnt)) then Must_Be_Imported (Entity (Name (GParnt))); @@ -3343,7 +3370,6 @@ package body Sem_Attr is Bad_Null_Parameter ("Null_Parameter must be actual or default parameter"); end if; - end Null_Parameter; ----------------- @@ -3356,6 +3382,22 @@ package body Sem_Attr is Check_Not_Incomplete_Type; Set_Etype (N, Universal_Integer); + --------- + -- Old -- + --------- + + when Attribute_Old => + Check_E0; + Set_Etype (N, P_Type); + + if not Is_Subprogram (Current_Scope) then + Error_Attr ("attribute % can only appear within subprogram", N); + end if; + + if Is_Limited_Type (P_Type) then + Error_Attr ("attribute % cannot apply to limited objects", P); + end if; + ------------ -- Output -- ------------ @@ -3370,7 +3412,8 @@ package body Sem_Attr is -- Partition_ID -- ------------------ - when Attribute_Partition_ID => + when Attribute_Partition_ID => Partition_Id : + begin Check_E0; if P_Type /= Any_Type then @@ -3378,9 +3421,8 @@ package body Sem_Attr is Error_Attr_P ("prefix of % attribute must be library-level entity"); - -- The defining entity of prefix should not be declared inside - -- a Pure unit. RM E.1(8). - -- The Is_Pure flag has been set during declaration. + -- The defining entity of prefix should not be declared inside a + -- Pure unit. RM E.1(8). Is_Pure was set during declaration. elsif Is_Entity_Name (P) and then Is_Pure (Entity (P)) @@ -3391,6 +3433,7 @@ package body Sem_Attr is end if; Set_Etype (N, Universal_Integer); + end Partition_Id; ------------------------- -- Passed_By_Reference -- @@ -3522,6 +3565,7 @@ package body Sem_Attr is ------------------ when Attribute_Range_Length => + Check_E0; Check_Discrete_Type; Set_Etype (N, Universal_Integer); @@ -3654,7 +3698,8 @@ package body Sem_Attr is -- Size -- ---------- - when Attribute_Size | Attribute_VADS_Size => + when Attribute_Size | Attribute_VADS_Size => Size : + begin Check_E0; -- If prefix is parameterless function call, rewrite and resolve @@ -3693,6 +3738,7 @@ package body Sem_Attr is Check_Not_Incomplete_Type; Set_Etype (N, Universal_Integer); + end Size; ----------- -- Small -- @@ -3707,10 +3753,11 @@ package body Sem_Attr is -- Storage_Pool -- ------------------ - when Attribute_Storage_Pool => - if Is_Access_Type (P_Type) then - Check_E0; + when Attribute_Storage_Pool => Storage_Pool : + begin + Check_E0; + if Is_Access_Type (P_Type) then if Ekind (P_Type) = E_Access_Subprogram_Type then Error_Attr_P ("cannot use % attribute for access-to-subprogram type"); @@ -3735,14 +3782,17 @@ package body Sem_Attr is else Error_Attr_P ("prefix of % attribute must be access type"); end if; + end Storage_Pool; ------------------ -- Storage_Size -- ------------------ - when Attribute_Storage_Size => + when Attribute_Storage_Size => Storage_Size : + begin + Check_E0; + if Is_Task_Type (P_Type) then - Check_E0; Set_Etype (N, Universal_Integer); elsif Is_Access_Type (P_Type) then @@ -3754,7 +3804,6 @@ package body Sem_Attr is if Is_Entity_Name (P) and then Is_Type (Entity (P)) then - Check_E0; Check_Type; Set_Etype (N, Universal_Integer); @@ -3768,7 +3817,6 @@ package body Sem_Attr is -- of an access value designating a task. else - Check_E0; Check_Task_Prefix; Set_Etype (N, Universal_Integer); end if; @@ -3776,6 +3824,7 @@ package body Sem_Attr is else Error_Attr_P ("prefix of % attribute must be access or task type"); end if; + end Storage_Size; ------------------ -- Storage_Unit -- @@ -3845,7 +3894,8 @@ package body Sem_Attr is -- Tag -- --------- - when Attribute_Tag => + when Attribute_Tag => Tag : + begin Check_E0; Check_Dereference; @@ -3875,6 +3925,7 @@ package body Sem_Attr is -- Set appropriate type Set_Etype (N, RTE (RE_Tag)); + end Tag; ----------------- -- Target_Name -- @@ -3886,7 +3937,6 @@ package body Sem_Attr is begin Check_Standard_Prefix; - Check_E0; TL := TN'Last; @@ -4022,9 +4072,7 @@ package body Sem_Attr is Negative := False; end if; - if Nkind (Expr) /= N_Integer_Literal - and then Nkind (Expr) /= N_Real_Literal - then + if not Nkind_In (Expr, N_Integer_Literal, N_Real_Literal) then Error_Attr ("named number for % attribute must be simple literal", N); end if; @@ -4987,12 +5035,11 @@ package body Sem_Attr is then P_Type := P_Entity; - -- We can fold 'Size applied to a type if the size is known - -- (as happens for a size from an attribute definition clause). - -- At this stage, this can happen only for types (e.g. record - -- types) for which the size is always non-static. We exclude - -- generic types from consideration (since they have bogus - -- sizes set within templates). + -- We can fold 'Size applied to a type if the size is known (as happens + -- for a size from an attribute definition clause). At this stage, this + -- can happen only for types (e.g. record types) for which the size is + -- always non-static. We exclude generic types from consideration (since + -- they have bogus sizes set within templates). elsif Id = Attribute_Size and then Is_Type (P_Entity) @@ -6924,6 +6971,7 @@ package body Sem_Attr is Attribute_Input | Attribute_Last_Bit | Attribute_Maximum_Alignment | + Attribute_Old | Attribute_Output | Attribute_Partition_ID | Attribute_Pool_Address | @@ -6961,10 +7009,10 @@ package body Sem_Attr is -- An exception is the GNAT attribute Constrained_Array which is -- defined to be a static attribute in all cases. - if Nkind (N) = N_Integer_Literal - or else Nkind (N) = N_Real_Literal - or else Nkind (N) = N_Character_Literal - or else Nkind (N) = N_String_Literal + if Nkind_In (N, N_Integer_Literal, + N_Real_Literal, + N_Character_Literal, + N_String_Literal) or else (Is_Entity_Name (N) and then Ekind (Entity (N)) = E_Enumeration_Literal) then @@ -7060,9 +7108,8 @@ package body Sem_Attr is if Is_Record_Type (Current_Scope) and then - (Nkind (Parent (N)) = N_Discriminant_Association - or else - Nkind (Parent (N)) = N_Index_Or_Discriminant_Constraint) + Nkind_In (Parent (N), N_Discriminant_Association, + N_Index_Or_Discriminant_Constraint) then Indic := Parent (Parent (N)); while Present (Indic) @@ -7122,7 +7169,8 @@ package body Sem_Attr is | Attribute_Unchecked_Access | Attribute_Unrestricted_Access => - Access_Attribute : begin + Access_Attribute : + begin if Is_Variable (P) then Note_Possible_Modification (P); end if; diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index 9bcd622a426..b9dbfb18f94 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -28,6 +28,7 @@ with Debug; use Debug; with Einfo; use Einfo; with Elists; use Elists; with Errout; use Errout; +with Exp_Util; use Exp_Util; with Fname; use Fname; with Lib; use Lib; with Namet; use Namet; @@ -214,11 +215,26 @@ package body Sem_Cat is -- Here we have an error else - if Is_Subunit then + -- Don't give error if main unit is not an internal unit, and the + -- unit generating the message is an internal unit. This is the + -- situation in which such messages would be ignored in any case, + -- so it is convenient not to generate them (since it causes + -- annoying inteference with debugging) + + if Is_Internal_File_Name (Unit_File_Name (Current_Sem_Unit)) + and then not Is_Internal_File_Name (Unit_File_Name (Main_Unit)) + then + return; + + -- Subunit case + + elsif Is_Subunit then Error_Msg_NE ("<subunit cannot depend on& " & "(parent has wrong categorization)", N, Depended_Entity); + -- Normal unit, not subunit + else Error_Msg_NE ("<cannot depend on& " & @@ -660,8 +676,7 @@ package body Sem_Cat is -- previous analysis. if Nkind (PN) = N_Pragma then - - case Get_Pragma_Id (Chars (PN)) is + case Get_Pragma_Id (PN) is when Pragma_All_Calls_Remote | Pragma_Preelaborate | Pragma_Pure | @@ -1297,12 +1312,36 @@ package body Sem_Cat is Primitive_Subprograms : Elist_Id; Subprogram_Elmt : Elmt_Id; Subprogram : Entity_Id; - Profile : List_Id; Param_Spec : Node_Id; Param : Entity_Id; Param_Type : Entity_Id; Rtyp : Node_Id; + procedure Illegal_RACW (Msg : String; N : Node_Id); + -- Diagnose that T is illegal because of the given reason, associated + -- with the location of node N. + + Illegal_RACW_Message_Issued : Boolean := False; + -- Set True once Illegal_RACW has been called + + ------------------ + -- Illegal_RACW -- + ------------------ + + procedure Illegal_RACW (Msg : String; N : Node_Id) is + begin + if not Illegal_RACW_Message_Issued then + Error_Msg_N + ("illegal remote access to class-wide type&", T); + Illegal_RACW_Message_Issued := True; + end if; + + Error_Msg_Sloc := Sloc (N); + Error_Msg_N ("\\" & Msg & " in primitive#", T); + end Illegal_RACW; + + -- Start of processing for Validate_RACW_Primitives + begin Desig_Type := Etype (Designated_Type (T)); @@ -1312,7 +1351,9 @@ package body Sem_Cat is while Subprogram_Elmt /= No_Elmt loop Subprogram := Node (Subprogram_Elmt); - if not Comes_From_Source (Subprogram) then + if Is_Predefined_Dispatching_Operation (Subprogram) + or else Is_Hidden (Subprogram) + then goto Next_Subprogram; end if; @@ -1325,15 +1366,14 @@ package body Sem_Cat is null; elsif Ekind (Rtyp) = E_Anonymous_Access_Type then - Error_Msg_N - ("anonymous access result in remote object primitive", Rtyp); + Illegal_RACW ("anonymous access result", Rtyp); elsif Is_Limited_Type (Rtyp) then if No (TSS (Rtyp, TSS_Stream_Read)) or else No (TSS (Rtyp, TSS_Stream_Write)) then - Error_Msg_N + Illegal_RACW ("limited return type must have Read and Write attributes", Parent (Subprogram)); Explain_Limited_Type (Rtyp, Parent (Subprogram)); @@ -1342,16 +1382,12 @@ package body Sem_Cat is end if; end if; - Profile := Parameter_Specifications (Parent (Subprogram)); - - -- Profile must exist, otherwise not primitive operation - - Param_Spec := First (Profile); - while Present (Param_Spec) loop + Param := First_Formal (Subprogram); + while Present (Param) loop -- Now find out if this parameter is a controlling parameter - Param := Defining_Identifier (Param_Spec); + Param_Spec := Parent (Param); Param_Type := Etype (Param); if Is_Controlling_Formal (Param) then @@ -1361,13 +1397,13 @@ package body Sem_Cat is null; - elsif Ekind (Param_Type) = E_Anonymous_Access_Type then - + elsif Ekind (Param_Type) = E_Anonymous_Access_Type + or else Ekind (Param_Type) = E_Anonymous_Access_Subprogram_Type + then -- From RM E.2.2(14), no access parameter other than -- controlling ones may be used. - Error_Msg_N - ("non-controlling access parameter", Param_Spec); + Illegal_RACW ("non-controlling access parameter", Param_Spec); elsif Is_Limited_Type (Param_Type) then @@ -1378,7 +1414,7 @@ package body Sem_Cat is or else No (TSS (Param_Type, TSS_Stream_Write)) then - Error_Msg_N + Illegal_RACW ("limited formal must have Read and Write attributes", Param_Spec); Explain_Limited_Type (Param_Type, Param_Spec); @@ -1387,7 +1423,7 @@ package body Sem_Cat is -- Check next parameter in this subprogram - Next (Param_Spec); + Next_Formal (Param); end loop; <<Next_Subprogram>> @@ -1654,7 +1690,7 @@ package body Sem_Cat is Error_Msg_N ("error in designated type of remote access to class-wide type", T); Error_Msg_N - ("\must be tagged limited private or private extension of type", T); + ("\must be tagged limited private or private extension", T); return; end if; @@ -1788,7 +1824,7 @@ package body Sem_Cat is return; end if; - Error_Msg_N ("incorrect remote type dereference", N); + Error_Msg_N ("incorrect dereference of remote type", N); end if; end Validate_Remote_Access_To_Class_Wide_Type; diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index cc8fcb39063..665c1efb861 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -387,9 +387,9 @@ package body Sem_Ch10 is elsif Nkind (Cont_Item) = N_Pragma and then - (Chars (Cont_Item) = Name_Elaborate + (Pragma_Name (Cont_Item) = Name_Elaborate or else - Chars (Cont_Item) = Name_Elaborate_All) + Pragma_Name (Cont_Item) = Name_Elaborate_All) and then not Used_Type_Or_Elab then Prag_Unit := @@ -759,7 +759,7 @@ package body Sem_Ch10 is Set_Acts_As_Spec (N, False); Set_Is_Child_Unit (Defining_Entity (Unit_Node)); - Set_Needs_Debug_Info (Defining_Entity (Unit (Lib_Unit))); + Set_Debug_Info_Needed (Defining_Entity (Unit (Lib_Unit))); Set_Comes_From_Source_Default (SCS); end; end if; @@ -910,7 +910,6 @@ package body Sem_Ch10 is Add_Stub_Constructs (N); end if; - end if; -- Remove unit from visibility, so that environment is clean for @@ -1005,8 +1004,13 @@ package body Sem_Ch10 is then Nam := Entity (Name (Item)); + -- Compile generic subprogram, unless it is intrinsic or + -- imported so no body is required, or generic package body + -- if the package spec requires a body. + if (Is_Generic_Subprogram (Nam) - and then not Is_Intrinsic_Subprogram (Nam)) + and then not Is_Intrinsic_Subprogram (Nam) + and then not Is_Imported (Nam)) or else (Ekind (Nam) = E_Generic_Package and then Unit_Requires_Body (Nam)) then @@ -1237,7 +1241,7 @@ package body Sem_Ch10 is Item := First (Context_Items (N)); while Present (Item) and then Nkind (Item) = N_Pragma - and then Chars (Item) in Configuration_Pragma_Names + and then Pragma_Name (Item) in Configuration_Pragma_Names loop Analyze (Item); Next (Item); @@ -1732,7 +1736,6 @@ package body Sem_Ch10 is else Optional_Subunit; end if; - end Analyze_Proper_Body; ---------------------------------- @@ -2693,20 +2696,21 @@ package body Sem_Ch10 is begin New_Nodes_OK := New_Nodes_OK + 1; Withn := - Make_With_Clause (Loc, Name => Build_Unit_Name (Nam)); + Make_With_Clause (Loc, + Name => Build_Unit_Name (Nam)); P := Parent (Unit_Declaration_Node (Ent)); - Set_Library_Unit (Withn, P); - Set_Corresponding_Spec (Withn, Ent); - Set_First_Name (Withn, True); - Set_Implicit_With (Withn, True); + Set_Library_Unit (Withn, P); + Set_Corresponding_Spec (Withn, Ent); + Set_First_Name (Withn, True); + Set_Implicit_With (Withn, True); -- If the unit is a package declaration, a private_with_clause on a -- child unit implies that the implicit with on the parent is also -- private. if Nkind (Unit (N)) = N_Package_Declaration then - Set_Private_Present (Withn, Private_Present (Item)); + Set_Private_Present (Withn, Private_Present (Item)); end if; Prepend (Withn, Context_Items (N)); @@ -2729,13 +2733,10 @@ package body Sem_Ch10 is if Nkind (Unit) = N_Package_Body and then Nkind (Original_Node (Unit)) = N_Package_Instantiation then - return - Defining_Entity - (Specification (Instance_Spec (Original_Node (Unit)))); - + return Defining_Entity + (Specification (Instance_Spec (Original_Node (Unit)))); elsif Nkind (Unit) = N_Package_Instantiation then return Defining_Entity (Specification (Instance_Spec (Unit))); - else return Defining_Entity (Unit); end if; @@ -2890,7 +2891,6 @@ package body Sem_Ch10 is end if; Install_Limited_Context_Clauses (N); - end Install_Context; ----------------------------- @@ -2913,7 +2913,7 @@ package body Sem_Ch10 is Item := First (Context_Items (N)); while Present (Item) and then Nkind (Item) = N_Pragma - and then Chars (Item) in Configuration_Pragma_Names + and then Pragma_Name (Item) in Configuration_Pragma_Names loop Next (Item); end loop; @@ -3713,6 +3713,7 @@ package body Sem_Ch10 is Item : Node_Id; Id : Entity_Id; Prev : Entity_Id; + begin -- Iterate over explicit with clauses, and check whether the scope of -- each entity is an ancestor of the current unit, in which case it is @@ -3950,8 +3951,8 @@ package body Sem_Ch10 is while Present (Item) loop if Nkind (Item) = N_With_Clause and then not Limited_Present (Item) - and then Nkind (Unit (Library_Unit (Item))) - = N_Package_Declaration + and then Nkind (Unit (Library_Unit (Item))) = + N_Package_Declaration then Decl := First (Visible_Declarations @@ -4599,13 +4600,13 @@ package body Sem_Ch10 is Unum : constant Unit_Number_Type := Get_Source_Unit (Library_Unit (N)); P : constant Entity_Id := Cunit_Entity (Unum); - Spec : Node_Id; -- To denote a package specification - Lim_Typ : Entity_Id; -- To denote shadow entities - Comp_Typ : Entity_Id; -- To denote real entities + Spec : Node_Id; -- To denote a package specification + Lim_Typ : Entity_Id; -- To denote shadow entities + Comp_Typ : Entity_Id; -- To denote real entities - Lim_Header : Entity_Id; -- Package entity - Last_Lim_E : Entity_Id := Empty; -- Last limited entity built - Last_Pub_Lim_E : Entity_Id; -- To set the first private entity + Lim_Header : Entity_Id; -- Package entity + Last_Lim_E : Entity_Id := Empty; -- Last limited entity built + Last_Pub_Lim_E : Entity_Id; -- To set the first private entity procedure Decorate_Incomplete_Type (E : Entity_Id; @@ -4805,8 +4806,8 @@ package body Sem_Ch10 is Set_Non_Limited_View (Lim_Typ, Comp_Typ); - elsif Nkind (Decl) = N_Private_Type_Declaration - or else Nkind (Decl) = N_Incomplete_Type_Declaration + elsif Nkind_In (Decl, N_Private_Type_Declaration, + N_Incomplete_Type_Declaration) then Comp_Typ := Defining_Identifier (Decl); @@ -4879,7 +4880,7 @@ package body Sem_Ch10 is Decorate_Package_Specification (Lim_Typ); Set_Scope (Lim_Typ, Scope); - Set_Chars (Lim_Typ, Chars (Comp_Typ)); + Set_Chars (Lim_Typ, Chars (Comp_Typ)); Set_Parent (Lim_Typ, Parent (Comp_Typ)); Set_From_With_Type (Lim_Typ); @@ -4958,8 +4959,9 @@ package body Sem_Ch10 is -- Build the header of the limited_view - Lim_Header := Make_Defining_Identifier (Sloc (N), - Chars => New_Internal_Name (Id_Char => 'Z')); + Lim_Header := + Make_Defining_Identifier (Sloc (N), + Chars => New_Internal_Name (Id_Char => 'Z')); Set_Ekind (Lim_Header, E_Package); Set_Is_Internal (Lim_Header); Set_Limited_View (P, Lim_Header); @@ -5410,7 +5412,6 @@ package body Sem_Ch10 is if Nkind (Item) = N_With_Clause and then Private_Present (Item) then - -- If private_with_clause is redundant, remove it from -- context, as a small optimization to subsequent handling -- of private_with clauses in other nested packages.. @@ -5418,7 +5419,6 @@ package body Sem_Ch10 is if In_Regular_With_Clause (Entity (Name (Item))) then declare Nxt : constant Node_Id := Next (Item); - begin Remove (Item); Item := Nxt; @@ -5451,7 +5451,6 @@ package body Sem_Ch10 is P : constant Entity_Id := Scope (Unit_Name); begin - if Debug_Flag_I then Write_Str ("remove unit "); Write_Name (Chars (Unit_Name)); diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 66cfc88a993..2be74709f09 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -437,7 +437,6 @@ package body Sem_Ch11 is Exception_Id : constant Node_Id := Name (N); Exception_Name : Entity_Id := Empty; P : Node_Id; - Nkind_P : Node_Kind; begin Check_Unreachable_Code (N); @@ -484,16 +483,13 @@ package body Sem_Ch11 is if No (Exception_Id) then P := Parent (N); - Nkind_P := Nkind (P); - - while Nkind_P /= N_Exception_Handler - and then Nkind_P /= N_Subprogram_Body - and then Nkind_P /= N_Package_Body - and then Nkind_P /= N_Task_Body - and then Nkind_P /= N_Entry_Body + while not Nkind_In (P, N_Exception_Handler, + N_Subprogram_Body, + N_Package_Body, + N_Task_Body, + N_Entry_Body) loop P := Parent (P); - Nkind_P := Nkind (P); end loop; if Nkind (P) /= N_Exception_Handler then @@ -506,7 +502,15 @@ package body Sem_Ch11 is else Set_Local_Raise_Not_OK (P); - Check_Restriction (No_Exception_Propagation, N); + + -- Do not check the restriction if the reraise statement is part + -- of the code generated for an AT-END handler. That's because + -- if the restriction is actually active, we never generate this + -- raise anyway, so the apparent violation is bogus. + + if not From_At_End (N) then + Check_Restriction (No_Exception_Propagation, N); + end if; end if; -- Normal case with exception id present diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 4a830603f12..a2019a6e427 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -434,15 +434,17 @@ package body Sem_Ch12 is function Find_Actual_Type (Typ : Entity_Id; - Gen_Scope : Entity_Id) return Entity_Id; + Gen_Type : Entity_Id) return Entity_Id; -- When validating the actual types of a child instance, check whether -- the formal is a formal type of the parent unit, and retrieve the current -- actual for it. Typ is the entity in the analyzed formal type declaration -- (component or index type of an array type, or designated type of an - -- access formal) and Gen_Scope is the scope of the analyzed formal array + -- access formal) and Gen_Type is the enclosing analyzed formal array -- or access type. The desired actual may be a formal of a parent, or may -- be declared in a formal package of a parent. In both cases it is a -- generic actual type because it appears within a visible instance. + -- Finally, it may be declared in a parent unit without being a formal + -- of that unit, in which case it must be retrieved by visibility. -- Ambiguities may still arise if two homonyms are declared in two formal -- packages, and the prefix of the formal type may be needed to resolve -- the ambiguity in the instance ??? @@ -1066,6 +1068,7 @@ package body Sem_Ch12 is procedure Set_Analyzed_Formal is Kind : Node_Kind; + begin while Present (Analyzed_Formal) loop Kind := Nkind (Analyzed_Formal); @@ -1081,12 +1084,9 @@ package body Sem_Ch12 is (Defining_Unit_Name (Specification (Analyzed_Formal))); when N_Formal_Package_Declaration => - exit when - Kind = N_Formal_Package_Declaration - or else - Kind = N_Generic_Package_Declaration - or else - Kind = N_Package_Declaration; + exit when Nkind_In (Kind, N_Formal_Package_Declaration, + N_Generic_Package_Declaration, + N_Package_Declaration); when N_Use_Package_Clause | N_Use_Type_Clause => exit; @@ -1097,10 +1097,10 @@ package body Sem_Ch12 is exit when Kind not in N_Formal_Subprogram_Declaration - and then Kind /= N_Subprogram_Declaration - and then Kind /= N_Freeze_Entity - and then Kind /= N_Null_Statement - and then Kind /= N_Itype_Reference + and then not Nkind_In (Kind, N_Subprogram_Declaration, + N_Freeze_Entity, + N_Null_Statement, + N_Itype_Reference) and then Chars (Defining_Identifier (Formal)) = Chars (Defining_Identifier (Analyzed_Formal)); end case; @@ -1123,6 +1123,7 @@ package body Sem_Ch12 is while Present (Actual) loop if Nkind (Actual) = N_Others_Choice then Others_Present := True; + if Present (Next (Actual)) then Error_Msg_N ("others must be last association", Actual); end if; @@ -1181,7 +1182,7 @@ package body Sem_Ch12 is -- to the outer instantiation. if Nkind (Named) /= N_Others_Choice - and then Present (Explicit_Generic_Actual_Parameter (Named)) + and then Present (Explicit_Generic_Actual_Parameter (Named)) then Num_Actuals := Num_Actuals + 1; end if; @@ -1474,9 +1475,9 @@ package body Sem_Ch12 is if Nkind (Def) = N_Constrained_Array_Definition then DSS := First (Discrete_Subtype_Definitions (Def)); while Present (DSS) loop - if Nkind (DSS) = N_Subtype_Indication - or else Nkind (DSS) = N_Range - or else Nkind (DSS) = N_Attribute_Reference + if Nkind_In (DSS, N_Subtype_Indication, + N_Range, + N_Attribute_Reference) then Error_Msg_N ("only a subtype mark is allowed in a formal", DSS); end if; @@ -1499,8 +1500,8 @@ package body Sem_Ch12 is elsif Is_Internal (Component_Type (T)) and then Present (Subtype_Indication (Component_Definition (Def))) and then Nkind (Original_Node - (Subtype_Indication (Component_Definition (Def)))) - = N_Subtype_Indication + (Subtype_Indication (Component_Definition (Def)))) = + N_Subtype_Indication then Error_Msg_N ("in a formal, a subtype indication can only be " @@ -2377,7 +2378,6 @@ package body Sem_Ch12 is end if; elsif Nkind (Def) = N_Indexed_Component then - if Nkind (Prefix (Def)) /= N_Selected_Component then Error_Msg_N ("expect valid subprogram name as default", Def); return; @@ -3124,7 +3124,7 @@ package body Sem_Ch12 is Inline_Now := True; -- In configurable_run_time mode we force the inlining of - -- predefined subprogram marked Inline_Always, to minimize + -- predefined subprograms marked Inline_Always, to minimize -- the use of the run-time library. elsif Is_Predefined_File_Name @@ -3194,10 +3194,11 @@ package body Sem_Ch12 is begin if Nkind (Decl) = N_Formal_Package_Declaration or else (Nkind (Decl) = N_Package_Declaration - and then Is_List_Member (Decl) - and then Present (Next (Decl)) - and then - Nkind (Next (Decl)) = N_Formal_Package_Declaration) + and then Is_List_Member (Decl) + and then Present (Next (Decl)) + and then + Nkind (Next (Decl)) = + N_Formal_Package_Declaration) then Needs_Body := False; end if; @@ -3825,7 +3826,7 @@ package body Sem_Ch12 is Set_Instance_Spec (N, Pack_Decl); Set_Is_Generic_Instance (Pack_Id); - Set_Needs_Debug_Info (Pack_Id); + Set_Debug_Info_Needed (Pack_Id); -- Case of not a compilation unit @@ -3875,7 +3876,7 @@ package body Sem_Ch12 is end if; Set_Is_Generic_Instance (Anon_Id); - Set_Needs_Debug_Info (Anon_Id); + Set_Debug_Info_Needed (Anon_Id); Act_Decl_Id := New_Copy (Anon_Id); Set_Parent (Act_Decl_Id, Parent (Anon_Id)); @@ -4207,15 +4208,15 @@ package body Sem_Ch12 is ------------------------- function Get_Associated_Node (N : Node_Id) return Node_Id is - Assoc : Node_Id := Associated_Node (N); + Assoc : Node_Id; begin + Assoc := Associated_Node (N); + if Nkind (Assoc) /= Nkind (N) then return Assoc; - elsif Nkind (Assoc) = N_Aggregate - or else Nkind (Assoc) = N_Extension_Aggregate - then + elsif Nkind_In (Assoc, N_Aggregate, N_Extension_Aggregate) then return Assoc; else @@ -4235,15 +4236,11 @@ package body Sem_Ch12 is if (Nkind (Assoc) = N_Identifier or else Nkind (Assoc) in N_Op) and then Present (Associated_Node (Assoc)) - and then (Nkind (Associated_Node (Assoc)) = N_Function_Call - or else - Nkind (Associated_Node (Assoc)) = N_Explicit_Dereference - or else - Nkind (Associated_Node (Assoc)) = N_Integer_Literal - or else - Nkind (Associated_Node (Assoc)) = N_Real_Literal - or else - Nkind (Associated_Node (Assoc)) = N_String_Literal) + and then (Nkind_In (Associated_Node (Assoc), N_Function_Call, + N_Explicit_Dereference, + N_Integer_Literal, + N_Real_Literal, + N_String_Literal)) then Assoc := Associated_Node (Assoc); end if; @@ -4396,9 +4393,9 @@ package body Sem_Ch12 is if Kind = N_Formal_Type_Declaration then return; - elsif Kind = N_Formal_Object_Declaration + elsif Nkind_In (Kind, N_Formal_Object_Declaration, + N_Formal_Package_Declaration) or else Kind in N_Formal_Subprogram_Declaration - or else Kind = N_Formal_Package_Declaration then null; @@ -5625,10 +5622,10 @@ package body Sem_Ch12 is -- Special casing for identifiers and other entity names and operators - elsif Nkind (New_N) = N_Identifier - or else Nkind (New_N) = N_Character_Literal - or else Nkind (New_N) = N_Expanded_Name - or else Nkind (New_N) = N_Operator_Symbol + elsif Nkind_In (New_N, N_Identifier, + N_Character_Literal, + N_Expanded_Name, + N_Operator_Symbol) or else Nkind (New_N) in N_Op then if not Instantiating then @@ -5673,20 +5670,19 @@ package body Sem_Ch12 is elsif No (Ent) or else - not (Nkind (Ent) = N_Defining_Identifier - or else - Nkind (Ent) = N_Defining_Character_Literal - or else - Nkind (Ent) = N_Defining_Operator_Symbol) + not Nkind_In (Ent, N_Defining_Identifier, + N_Defining_Character_Literal, + N_Defining_Operator_Symbol) or else No (Scope (Ent)) or else (Scope (Ent) = Current_Instantiated_Parent.Gen_Id and then not Is_Child_Unit (Ent)) - or else (Scope_Depth (Scope (Ent)) > + or else + (Scope_Depth (Scope (Ent)) > Scope_Depth (Current_Instantiated_Parent.Gen_Id) - and then - Get_Source_Unit (Ent) = - Get_Source_Unit (Current_Instantiated_Parent.Gen_Id)) + and then + Get_Source_Unit (Ent) = + Get_Source_Unit (Current_Instantiated_Parent.Gen_Id)) then Set_Associated_Node (New_N, Empty); end if; @@ -5702,6 +5698,7 @@ package body Sem_Ch12 is declare Assoc : constant Node_Id := Get_Associated_Node (N); + begin if Present (Assoc) then if Nkind (Assoc) = Nkind (N) then @@ -5711,9 +5708,9 @@ package body Sem_Ch12 is elsif Nkind (Assoc) = N_Function_Call then Set_Entity (New_N, Entity (Name (Assoc))); - elsif (Nkind (Assoc) = N_Defining_Identifier - or else Nkind (Assoc) = N_Defining_Character_Literal - or else Nkind (Assoc) = N_Defining_Operator_Symbol) + elsif Nkind_In (Assoc, N_Defining_Identifier, + N_Defining_Character_Literal, + N_Defining_Operator_Symbol) and then Expander_Active then -- Inlining case: we are copying a tree that contains @@ -5902,9 +5899,7 @@ package body Sem_Ch12 is Set_Assignment_OK (Name (New_N), True); end if; - elsif Nkind (N) = N_Aggregate - or else Nkind (N) = N_Extension_Aggregate - then + elsif Nkind_In (N, N_Aggregate, N_Extension_Aggregate) then if not Instantiating then Set_Associated_Node (N, New_N); @@ -6029,22 +6024,20 @@ package body Sem_Ch12 is and then Instantiating then declare - Prag_Id : constant Pragma_Id := Get_Pragma_Id (Chars (N)); - + Prag_Id : constant Pragma_Id := Get_Pragma_Id (N); begin if Prag_Id = Pragma_Ident or else Prag_Id = Pragma_Comment then New_N := Make_Null_Statement (Sloc (N)); - else Copy_Descendants; end if; end; - elsif Nkind (N) = N_Integer_Literal - or else Nkind (N) = N_Real_Literal - or else Nkind (N) = N_String_Literal + elsif Nkind_In (N, N_Integer_Literal, + N_Real_Literal, + N_String_Literal) then -- No descendant fields need traversing @@ -6145,20 +6138,34 @@ package body Sem_Ch12 is ---------------------- function Find_Actual_Type - (Typ : Entity_Id; - Gen_Scope : Entity_Id) return Entity_Id + (Typ : Entity_Id; + Gen_Type : Entity_Id) return Entity_Id is - T : Entity_Id; + Gen_Scope : constant Entity_Id := Scope (Gen_Type); + T : Entity_Id; begin + -- Special processing only applies to child units + if not Is_Child_Unit (Gen_Scope) then return Get_Instance_Of (Typ); + -- If designated or component type is itself a formal of the child unit, + -- its instance is available. + + elsif Scope (Typ) = Gen_Scope then + return Get_Instance_Of (Typ); + + -- If the array or access type is not declared in the parent unit, + -- no special processing needed. + elsif not Is_Generic_Type (Typ) - or else Scope (Typ) = Gen_Scope + and then Scope (Gen_Scope) /= Scope (Typ) then return Get_Instance_Of (Typ); + -- Otherwise, retrieve designated or component type by visibility + else T := Current_Entity (Typ); while Present (T) loop @@ -6397,7 +6404,7 @@ package body Sem_Ch12 is or else (Nkind (Enc_I) = N_Package_Body and then - In_Same_Declarative_Part (Freeze_Node (Par), Parent (Enc_I))) + In_Same_Declarative_Part (Freeze_Node (Par), Parent (Enc_I))) then -- The enclosing package may contain several instances. Rather -- than computing the earliest point at which to insert its @@ -6511,8 +6518,8 @@ package body Sem_Ch12 is if Nkind (Package_Instantiation (A)) = N_Package_Instantiation then return Package_Instantiation (A); - elsif Nkind (Original_Node (Package_Instantiation (A))) - = N_Package_Instantiation + elsif Nkind (Original_Node (Package_Instantiation (A))) = + N_Package_Instantiation then return Original_Node (Package_Instantiation (A)); end if; @@ -6554,8 +6561,8 @@ package body Sem_Ch12 is else Inst := Next (Decl); - while Nkind (Inst) /= N_Package_Instantiation - and then Nkind (Inst) /= N_Formal_Package_Declaration + while not Nkind_In (Inst, N_Package_Instantiation, + N_Formal_Package_Declaration) loop Next (Inst); end loop; @@ -6677,11 +6684,11 @@ package body Sem_Ch12 is if Nod = Decls then return True; - elsif Nkind (Nod) = N_Subprogram_Body - or else Nkind (Nod) = N_Package_Body - or else Nkind (Nod) = N_Task_Body - or else Nkind (Nod) = N_Protected_Body - or else Nkind (Nod) = N_Block_Statement + elsif Nkind_In (Nod, N_Subprogram_Body, + N_Package_Body, + N_Task_Body, + N_Protected_Body, + N_Block_Statement) then return False; @@ -6690,6 +6697,7 @@ package body Sem_Ch12 is elsif Nkind (Nod) = N_Compilation_Unit then return False; + else Nod := Parent (Nod); end if; @@ -6728,7 +6736,7 @@ package body Sem_Ch12 is -- might produce false positives in rare cases, but guarantees -- that we produce all the instance bodies we will need. - if (Nkind (Nam) = N_Identifier + if (Is_Entity_Name (Nam) and then Chars (Nam) = Chars (E)) or else (Nkind (Nam) = N_Selected_Component and then Chars (Selector_Name (Nam)) = Chars (E)) @@ -6895,6 +6903,7 @@ package body Sem_Ch12 is -- Start of processing for Install_Body begin + -- If the body is a subunit, the freeze point is the corresponding -- stub in the current compilation, not the subunit itself. @@ -6919,8 +6928,8 @@ package body Sem_Ch12 is Must_Delay := (Gen_Unit = Act_Unit - and then ((Nkind (Gen_Unit) = N_Package_Declaration) - or else Nkind (Gen_Unit) = N_Generic_Package_Declaration + and then (Nkind_In (Gen_Unit, N_Package_Declaration, + N_Generic_Package_Declaration) or else (Gen_Unit = Body_Unit and then True_Sloc (N) < Sloc (Orig_Body))) and then Is_In_Main_Unit (Gen_Unit) @@ -7827,10 +7836,10 @@ package body Sem_Ch12 is end if; if (Present (Act_E) and then Is_Overloadable (Act_E)) - or else Nkind (Act) = N_Attribute_Reference - or else Nkind (Act) = N_Indexed_Component - or else Nkind (Act) = N_Character_Literal - or else Nkind (Act) = N_Explicit_Dereference + or else Nkind_In (Act, N_Attribute_Reference, + N_Indexed_Component, + N_Character_Literal, + N_Explicit_Dereference) then return; end if; @@ -7900,10 +7909,10 @@ package body Sem_Ch12 is Nam := Actual; elsif Present (Default_Name (Formal)) then - if Nkind (Default_Name (Formal)) /= N_Attribute_Reference - and then Nkind (Default_Name (Formal)) /= N_Selected_Component - and then Nkind (Default_Name (Formal)) /= N_Indexed_Component - and then Nkind (Default_Name (Formal)) /= N_Character_Literal + if not Nkind_In (Default_Name (Formal), N_Attribute_Reference, + N_Selected_Component, + N_Indexed_Component, + N_Character_Literal) and then Present (Entity (Default_Name (Formal))) then Nam := New_Occurrence_Of (Entity (Default_Name (Formal)), Loc); @@ -8297,7 +8306,7 @@ package body Sem_Ch12 is -- a child unit. if Nkind (Actual) = N_Aggregate then - Pre_Analyze_And_Resolve (Actual, Typ); + Pre_Analyze_And_Resolve (Actual, Typ); end if; if Is_Limited_Type (Typ) @@ -8385,8 +8394,8 @@ package body Sem_Ch12 is if Ada_Version >= Ada_05 and then Present (Actual_Decl) and then - (Nkind (Actual_Decl) = N_Formal_Object_Declaration - or else Nkind (Actual_Decl) = N_Object_Declaration) + Nkind_In (Actual_Decl, N_Formal_Object_Declaration, + N_Object_Declaration) and then Nkind (Analyzed_Formal) = N_Formal_Object_Declaration and then Has_Null_Exclusion (Actual_Decl) and then not Has_Null_Exclusion (Analyzed_Formal) @@ -8685,8 +8694,24 @@ package body Sem_Ch12 is Scope_Suppress := Body_Info.Scope_Suppress; if No (Gen_Body_Id) then - Load_Parent_Of_Generic (Inst_Node, Specification (Gen_Decl)); - Gen_Body_Id := Corresponding_Body (Gen_Decl); + + -- For imported generic subprogram, no body to compile, complete + -- the spec entity appropriately. + + if Is_Imported (Gen_Unit) then + Set_Is_Imported (Anon_Id); + Set_First_Rep_Item (Anon_Id, First_Rep_Item (Gen_Unit)); + Set_Interface_Name (Anon_Id, Interface_Name (Gen_Unit)); + Set_Convention (Anon_Id, Convention (Gen_Unit)); + Set_Has_Completion (Anon_Id); + return; + + -- For other cases, commpile the body + + else + Load_Parent_Of_Generic (Inst_Node, Specification (Gen_Decl)); + Gen_Body_Id := Corresponding_Body (Gen_Decl); + end if; end if; Instantiation_Node := Inst_Node; @@ -9011,8 +9036,8 @@ package body Sem_Ch12 is procedure Validate_Access_Type_Instance is Desig_Type : constant Entity_Id := - Find_Actual_Type - (Designated_Type (A_Gen_T), Scope (A_Gen_T)); + Find_Actual_Type (Designated_Type (A_Gen_T), A_Gen_T); + Desig_Act : Entity_Id; begin if not Is_Access_Type (Act_T) then @@ -9046,9 +9071,19 @@ package body Sem_Ch12 is -- by an access type declaration (and not by a subtype declaration) -- must match. - if not Subtypes_Match - (Desig_Type, Designated_Type (Base_Type (Act_T))) + Desig_Act := Designated_Type (Base_Type (Act_T)); + + -- The designated type may have been introduced through a limited_ + -- with clause, in which case retrieve the non-limited view. + + if Ekind (Desig_Act) = E_Incomplete_Type + and then From_With_Type (Desig_Act) then + Desig_Act := Available_View (Desig_Act); + end if; + + if not Subtypes_Match + (Desig_Type, Desig_Act) then Error_Msg_NE ("designated type of actual does not match that of formal &", Actual, Gen_T); @@ -9155,7 +9190,7 @@ package body Sem_Ch12 is end if; if not Subtypes_Match - (Find_Actual_Type (Etype (I1), Scope (A_Gen_T)), T2) + (Find_Actual_Type (Etype (I1), A_Gen_T), T2) then Error_Msg_NE ("index types of actual do not match those of formal &", @@ -9167,9 +9202,9 @@ package body Sem_Ch12 is Next_Index (I2); end loop; - if not Subtypes_Match ( - Find_Actual_Type (Component_Type (A_Gen_T), Scope (A_Gen_T)), - Component_Type (Act_T)) + if not Subtypes_Match + (Find_Actual_Type (Component_Type (A_Gen_T), A_Gen_T), + Component_Type (Act_T)) then Error_Msg_NE ("component subtype of actual does not match that of formal &", @@ -9184,7 +9219,6 @@ package body Sem_Ch12 is ("actual must have aliased components to match formal type &", Actual, Gen_T); end if; - end Validate_Array_Type_Instance; ----------------------------------------------- @@ -10151,9 +10185,9 @@ package body Sem_Ch12 is else Kind := Nkind (Parent (E)); return - Kind = N_Formal_Object_Declaration - or else Kind = N_Formal_Package_Declaration - or else Kind = N_Formal_Type_Declaration + Nkind_In (Kind, N_Formal_Object_Declaration, + N_Formal_Package_Declaration, + N_Formal_Type_Declaration) or else (Is_Formal_Subprogram (E) and then @@ -10670,6 +10704,20 @@ package body Sem_Ch12 is end if; if Errs /= Serious_Errors_Detected then + + -- Do a minimal analysis of the generic, to prevent spurious + -- warnings complaining about the generic being unreferenced, + -- before abandoning the instantiation. + + Analyze (Name (N)); + + if Is_Entity_Name (Name (N)) + and then Etype (Name (N)) /= Any_Type + then + Generate_Reference (Entity (Name (N)), Name (N)); + Set_Is_Instantiated (Entity (Name (N))); + end if; + Abandon_Instantiation (Act); end if; end if; @@ -10772,12 +10820,12 @@ package body Sem_Ch12 is Restore_Private_Views (Empty); end if; - Current_Instantiated_Parent := Saved.Instantiated_Parent; - Exchanged_Views := Saved.Exchanged_Views; - Hidden_Entities := Saved.Hidden_Entities; - Current_Sem_Unit := Saved.Current_Sem_Unit; - Parent_Unit_Visible := Saved.Parent_Unit_Visible; - Instance_Parent_Unit := Saved.Instance_Parent_Unit; + Current_Instantiated_Parent := Saved.Instantiated_Parent; + Exchanged_Views := Saved.Exchanged_Views; + Hidden_Entities := Saved.Hidden_Entities; + Current_Sem_Unit := Saved.Current_Sem_Unit; + Parent_Unit_Visible := Saved.Parent_Unit_Visible; + Instance_Parent_Unit := Saved.Instance_Parent_Unit; Restore_Opt_Config_Switches (Saved.Switches); @@ -10816,7 +10864,6 @@ package body Sem_Ch12 is return; elsif Present (Associated_Formal_Package (Formal)) then - Ent := First_Entity (Formal); while Present (Ent) loop exit when Ekind (Ent) = E_Package @@ -10890,8 +10937,8 @@ package body Sem_Ch12 is -- An unusual case of aliasing: the actual may also be directly -- visible in the generic, and be private there, while it is fully - -- visible in the context of the instance. The internal subtype is - -- private in the instance, but has full visibility like its + -- visible in the context of the instance. The internal subtype + -- is private in the instance, but has full visibility like its -- parent in the enclosing scope. This enforces the invariant that -- the privacy status of all private dependents of a type coincide -- with that of the parent type. This can only happen when a @@ -10915,8 +10962,8 @@ package body Sem_Ch12 is -- If the actual is itself a formal package for the enclosing -- generic, or the actual for such a formal package, it remains - -- visible on exit from the instance, and therefore nothing - -- needs to be done either, except to keep it accessible. + -- visible on exit from the instance, and therefore nothing needs + -- to be done either, except to keep it accessible. if Is_Package and then Renamed_Object (E) = Pack_Id @@ -11033,7 +11080,7 @@ package body Sem_Ch12 is --------------- function Is_Global (E : Entity_Id) return Boolean is - Se : Entity_Id := Scope (E); + Se : Entity_Id; function Is_Instance_Node (Decl : Node_Id) return Boolean; -- Determine whether the parent node of a reference to a child unit @@ -11064,13 +11111,15 @@ package body Sem_Ch12 is elsif Is_Child_Unit (E) and then (Is_Instance_Node (Parent (N2)) - or else (Nkind (Parent (N2)) = N_Expanded_Name - and then N2 = Selector_Name (Parent (N2)) - and then Is_Instance_Node (Parent (Parent (N2))))) + or else (Nkind (Parent (N2)) = N_Expanded_Name + and then N2 = Selector_Name (Parent (N2)) + and then + Is_Instance_Node (Parent (Parent (N2))))) then return True; else + Se := Scope (E); while Se /= Gen_Scope loop if Se = Standard_Standard then return True; @@ -11153,9 +11202,10 @@ package body Sem_Ch12 is ------------------ function Top_Ancestor (E : Entity_Id) return Entity_Id is - Par : Entity_Id := E; + Par : Entity_Id; begin + Par := E; while Is_Child_Unit (Par) loop Par := Scope (Par); end loop; @@ -11241,8 +11291,7 @@ package body Sem_Ch12 is -- its value. Otherwise the folding will happen in any instantiation, elsif Nkind (Parent (N)) = N_Selected_Component - and then (Nkind (Parent (N2)) = N_Integer_Literal - or else Nkind (Parent (N2)) = N_Real_Literal) + and then Nkind_In (Parent (N2), N_Integer_Literal, N_Real_Literal) then if Present (Entity (Original_Node (Parent (N2)))) and then Is_Global (Entity (Original_Node (Parent (N2)))) @@ -11504,9 +11553,7 @@ package body Sem_Ch12 is if N = Empty then null; - elsif Nkind (N) = N_Character_Literal - or else Nkind (N) = N_Operator_Symbol - then + elsif Nkind_In (N, N_Character_Literal, N_Operator_Symbol) then if Nkind (N) = Nkind (Get_Associated_Node (N)) then Reset_Entity (N); @@ -11545,9 +11592,9 @@ package body Sem_Ch12 is Set_Etype (N, Empty); end if; - elsif Nkind (N2) = N_Integer_Literal - or else Nkind (N2) = N_Real_Literal - or else Nkind (N2) = N_String_Literal + elsif Nkind_In (N2, N_Integer_Literal, + N_Real_Literal, + N_String_Literal) then if Present (Original_Node (N2)) and then Nkind (Original_Node (N2)) = Nkind (N) @@ -11588,8 +11635,7 @@ package body Sem_Ch12 is end if; end if; - -- Complete the check on operands, if node has not been - -- constant-folded. + -- Complete operands check if node has not been constant-folded if Nkind (N) in N_Op then Save_Entity_Descendants (N); @@ -11624,10 +11670,7 @@ package body Sem_Ch12 is Set_Etype (N, Empty); end if; - elsif - (Nkind (N2) = N_Integer_Literal - or else - Nkind (N2) = N_Real_Literal) + elsif Nkind_In (N2, N_Integer_Literal, N_Real_Literal) and then Is_Entity_Name (Original_Node (N2)) then -- Name resolves to named number that is constant-folded, @@ -11712,10 +11755,7 @@ package body Sem_Ch12 is -- traversal, so it needs direct access to node fields. begin - if Nkind (N) = N_Aggregate - or else - Nkind (N) = N_Extension_Aggregate - then + if Nkind_In (N, N_Aggregate, N_Extension_Aggregate) then N2 := Get_Associated_Node (N); if No (N2) then @@ -11723,10 +11763,10 @@ package body Sem_Ch12 is else Typ := Etype (N2); - -- In an instance within a generic, use the name of - -- the actual and not the original generic parameter. - -- If the actual is global in the current generic it - -- must be preserved for its instantiation. + -- In an instance within a generic, use the name of the + -- actual and not the original generic parameter. If the + -- actual is global in the current generic it must be + -- preserved for its instantiation. if Nkind (Parent (Typ)) = N_Subtype_Declaration and then @@ -11759,8 +11799,8 @@ package body Sem_Ch12 is if Nkind (N2) = Nkind (N) and then - (Nkind (Parent (N2)) = N_Procedure_Call_Statement - or else Nkind (Parent (N2)) = N_Function_Call) + Nkind_In (Parent (N2), N_Procedure_Call_Statement, + N_Function_Call) and then Comes_From_Source (Typ) then if Is_Immediately_Visible (Scope (Typ)) then diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 2b58c12edcd..c678d987808 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -180,17 +180,16 @@ package body Sem_Ch13 is and then Attribute_Name (N) = Name_Address then declare - Nam : Node_Id := Prefix (N); + P : Node_Id; + begin - while False - or else Nkind (Nam) = N_Selected_Component - or else Nkind (Nam) = N_Indexed_Component - loop - Nam := Prefix (Nam); + P := Prefix (N); + while Nkind_In (P, N_Selected_Component, N_Indexed_Component) loop + P := Prefix (P); end loop; - if Is_Entity_Name (Nam) then - return Entity (Nam); + if Is_Entity_Name (P) then + return Entity (P); end if; end; end if; @@ -1392,6 +1391,9 @@ package body Sem_Ch13 is Set_Has_Small_Clause (U_Ent); Set_Has_Small_Clause (Implicit_Base); Set_Has_Non_Standard_Rep (Implicit_Base); + + -- Recompute RM_Size, but shouldn't this be done in Freeze??? + Set_Discrete_RM_Size (U_Ent); end if; end Small; @@ -1749,10 +1751,10 @@ package body Sem_Ch13 is while Present (Decl) loop DeclO := Original_Node (Decl); if Comes_From_Source (DeclO) - and then Nkind (DeclO) /= N_Pragma - and then Nkind (DeclO) /= N_Use_Package_Clause - and then Nkind (DeclO) /= N_Use_Type_Clause - and then Nkind (DeclO) /= N_Implicit_Label_Declaration + and not Nkind_In (DeclO, N_Pragma, + N_Use_Package_Clause, + N_Use_Type_Clause, + N_Implicit_Label_Declaration) then Error_Msg_N ("this declaration not allowed in machine code subprogram", @@ -1769,9 +1771,9 @@ package body Sem_Ch13 is while Present (Stmt) loop StmtO := Original_Node (Stmt); if Comes_From_Source (StmtO) - and then Nkind (StmtO) /= N_Pragma - and then Nkind (StmtO) /= N_Label - and then Nkind (StmtO) /= N_Code_Statement + and then not Nkind_In (StmtO, N_Pragma, + N_Label, + N_Code_Statement) then Error_Msg_N ("this statement is not allowed in machine code subprogram", @@ -2284,7 +2286,7 @@ package body Sem_Ch13 is -- The only pragma of interest is Complete_Representation - if Chars (CC) = Name_Complete_Representation then + if Pragma_Name (CC) = Name_Complete_Representation then CR_Pragma := CC; end if; @@ -2346,13 +2348,12 @@ package body Sem_Ch13 is elsif Present (Component_Clause (Comp)) then -- Diagose duplicate rep clause, or check consistency - -- if this is inherited component. In a double fault, + -- if this is an inherited component. In a double fault, -- there may be a duplicate inconsistent clause for an -- inherited component. - if - Scope (Original_Record_Component (Comp)) = Rectype - or else Parent (Component_Clause (Comp)) = N + if Scope (Original_Record_Component (Comp)) = Rectype + or else Parent (Component_Clause (Comp)) = N then Error_Msg_Sloc := Sloc (Component_Clause (Comp)); Error_Msg_N ("component clause previously given#", CC); @@ -2360,7 +2361,6 @@ package body Sem_Ch13 is else declare Rep1 : constant Node_Id := Component_Clause (Comp); - begin if Intval (Position (Rep1)) /= Intval (Position (CC)) @@ -2371,7 +2371,6 @@ package body Sem_Ch13 is then Error_Msg_N ("component clause inconsistent " & "with representation of ancestor", CC); - elsif Warn_On_Redundant_Constructs then Error_Msg_N ("?redundant component clause " & "for inherited component!", CC); @@ -2467,30 +2466,30 @@ package body Sem_Ch13 is end loop; -- Now that we have processed all the component clauses, check for - -- overlap. We have to leave this till last, since the components - -- can appear in any arbitrary order in the representation clause. + -- overlap. We have to leave this till last, since the components can + -- appear in any arbitrary order in the representation clause. -- We do not need this check if all specified ranges were monotonic, -- as recorded by Overlap_Check_Required being False at this stage. - -- This first section checks if there are any overlapping entries - -- at all. It does this by sorting all entries and then seeing if - -- there are any overlaps. If there are none, then that is decisive, - -- but if there are overlaps, they may still be OK (they may result - -- from fields in different variants). + -- This first section checks if there are any overlapping entries at + -- all. It does this by sorting all entries and then seeing if there are + -- any overlaps. If there are none, then that is decisive, but if there + -- are overlaps, they may still be OK (they may result from fields in + -- different variants). if Overlap_Check_Required then Overlap_Check1 : declare OC_Fbit : array (0 .. Ccount) of Uint; - -- First-bit values for component clauses, the value is the - -- offset of the first bit of the field from start of record. - -- The zero entry is for use in sorting. + -- First-bit values for component clauses, the value is the offset + -- of the first bit of the field from start of record. The zero + -- entry is for use in sorting. OC_Lbit : array (0 .. Ccount) of Uint; - -- Last-bit values for component clauses, the value is the - -- offset of the last bit of the field from start of record. - -- The zero entry is for use in sorting. + -- Last-bit values for component clauses, the value is the offset + -- of the last bit of the field from start of record. The zero + -- entry is for use in sorting. OC_Count : Natural := 0; -- Count of entries in OC_Fbit and OC_Lbit @@ -2548,10 +2547,10 @@ package body Sem_Ch13 is end Overlap_Check1; end if; - -- If Overlap_Check_Required is still True, then we have to do - -- the full scale overlap check, since we have at least two fields - -- that do overlap, and we need to know if that is OK since they - -- are in the same variant, or whether we have a definite problem + -- If Overlap_Check_Required is still True, then we have to do the full + -- scale overlap check, since we have at least two fields that do + -- overlap, and we need to know if that is OK since they are in + -- different variant, or whether we have a definite problem. if Overlap_Check_Required then Overlap_Check2 : declare @@ -2569,7 +2568,7 @@ package body Sem_Ch13 is -- Loop through all components in record. For each component check -- for overlap with any of the preceding elements on the component - -- list containing the component, and also, if the component is in + -- list containing the component and also, if the component is in -- a variant, check against components outside the case structure. -- This latter test is repeated recursively up the variant tree. @@ -2597,7 +2596,7 @@ package body Sem_Ch13 is Component_List_Loop : loop -- If derived type definition, go to full declaration - -- If at outer level, check discriminants if there are any + -- If at outer level, check discriminants if there are any. if Nkind (Clist) = N_Derived_Type_Definition then Clist := Parent (Clist); @@ -2605,8 +2604,8 @@ package body Sem_Ch13 is -- Outer level of record definition, check discriminants - if Nkind (Clist) = N_Full_Type_Declaration - or else Nkind (Clist) = N_Private_Type_Declaration + if Nkind_In (Clist, N_Full_Type_Declaration, + N_Private_Type_Declaration) then if Has_Discriminants (Defining_Identifier (Clist)) then C2_Ent := @@ -2644,23 +2643,22 @@ package body Sem_Ch13 is -- be a variant, in which case its parent is a variant part, -- and the parent of the variant part is a component list -- whose components must all be checked against the current - -- component for overlap. + -- component for overlap). if Nkind (Parent (Clist)) = N_Variant then Clist := Parent (Parent (Parent (Clist))); -- Check for possible discriminant part in record, this is -- treated essentially as another level in the recursion. - -- For this case we have the parent of the component list - -- is the record definition, and its parent is the full - -- type declaration which contains the discriminant - -- specifications. + -- For this case the parent of the component list is the + -- record definition, and its parent is the full type + -- declaration containing the discriminant specifications. elsif Nkind (Parent (Clist)) = N_Record_Definition then Clist := Parent (Parent ((Clist))); -- If neither of these two cases, we are at the top of - -- the tree + -- the tree. else exit Component_List_Loop; @@ -2674,24 +2672,23 @@ package body Sem_Ch13 is end Overlap_Check2; end if; - -- For records that have component clauses for all components, and - -- whose size is less than or equal to 32, we need to know the size - -- in the front end to activate possible packed array processing - -- where the component type is a record. + -- For records that have component clauses for all components, and whose + -- size is less than or equal to 32, we need to know the size in the + -- front end to activate possible packed array processing where the + -- component type is a record. - -- At this stage Hbit + 1 represents the first unused bit from all - -- the component clauses processed, so if the component clauses are + -- At this stage Hbit + 1 represents the first unused bit from all the + -- component clauses processed, so if the component clauses are -- complete, then this is the length of the record. - -- For records longer than System.Storage_Unit, and for those where - -- not all components have component clauses, the back end determines - -- the length (it may for example be appopriate to round up the size - -- to some convenient boundary, based on alignment considerations etc). + -- For records longer than System.Storage_Unit, and for those where not + -- all components have component clauses, the back end determines the + -- length (it may for example be appopriate to round up the size + -- to some convenient boundary, based on alignment considerations, etc). - if Unknown_RM_Size (Rectype) - and then Hbit + 1 <= 32 - then - -- Nothing to do if at least one component with no component clause + if Unknown_RM_Size (Rectype) and then Hbit + 1 <= 32 then + + -- Nothing to do if at least one component has no component clause Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop @@ -2722,9 +2719,7 @@ package body Sem_Ch13 is -- If no Complete_Representation pragma, warn if missing components - elsif Warn_On_Unrepped_Components - and then not Warnings_Off (Rectype) - then + elsif Warn_On_Unrepped_Components then declare Num_Repped_Components : Nat := 0; Num_Unrepped_Components : Nat := 0; @@ -2736,7 +2731,6 @@ package body Sem_Ch13 is while Present (Comp) loop if Present (Component_Clause (Comp)) then Num_Repped_Components := Num_Repped_Components + 1; - else Num_Unrepped_Components := Num_Unrepped_Components + 1; end if; @@ -2763,6 +2757,7 @@ package body Sem_Ch13 is and then (Is_Scalar_Type (Underlying_Type (Etype (Comp))) or else Size_Known_At_Compile_Time (Underlying_Type (Etype (Comp)))) + and then not Has_Warnings_Off (Rectype) then Error_Msg_Sloc := Sloc (Comp); Error_Msg_NE @@ -2786,9 +2781,9 @@ package body Sem_Ch13 is if Present (Component_Clause (C1_Ent)) and then Present (Component_Clause (C2_Ent)) then - -- Exclude odd case where we have two tag fields in the same - -- record, both at location zero. This seems a bit strange, - -- but it seems to happen in some circumstances ??? + -- Exclude odd case where we have two tag fields in the same record, + -- both at location zero. This seems a bit strange, but it seems to + -- happen in some circumstances ??? if Chars (C1_Ent) = Name_uTag and then Chars (C2_Ent) = Name_uTag @@ -2830,14 +2825,14 @@ package body Sem_Ch13 is U_Ent : Entity_Id) is procedure Check_At_Constant_Address (Nod : Node_Id); - -- Checks that the given node N represents a name whose 'Address - -- is constant (in the same sense as OK_Constant_Address_Clause, - -- i.e. the address value is the same at the point of declaration - -- of U_Ent and at the time of elaboration of the address clause. + -- Checks that the given node N represents a name whose 'Address is + -- constant (in the same sense as OK_Constant_Address_Clause, i.e. the + -- address value is the same at the point of declaration of U_Ent and at + -- the time of elaboration of the address clause. procedure Check_Expr_Constants (Nod : Node_Id); - -- Checks that Nod meets the requirements for a constant address - -- clause in the sense of the enclosing procedure. + -- Checks that Nod meets the requirements for a constant address clause + -- in the sense of the enclosing procedure. procedure Check_List_Constants (Lst : List_Id); -- Check that all elements of list Lst meet the requirements for a @@ -2937,11 +2932,11 @@ package body Sem_Ch13 is -- If the node is an object declaration without initial -- value, some code has been expanded, and the expression -- is not constant, even if the constituents might be - -- acceptable, as in A'Address + offset. + -- acceptable, as in A'Address + offset. if Ekind (Ent) = E_Variable - and then Nkind (Declaration_Node (Ent)) - = N_Object_Declaration + and then + Nkind (Declaration_Node (Ent)) = N_Object_Declaration and then No (Expression (Declaration_Node (Ent))) then @@ -2981,16 +2976,16 @@ package body Sem_Ch13 is or else Ekind (Ent) = E_In_Parameter then - -- This is the case where we must have Ent defined - -- before U_Ent. Clearly if they are in different - -- units this requirement is met since the unit - -- containing Ent is already processed. + -- This is the case where we must have Ent defined before + -- U_Ent. Clearly if they are in different units this + -- requirement is met since the unit containing Ent is + -- already processed. if not In_Same_Source_Unit (Ent, U_Ent) then return; - -- Otherwise location of Ent must be before the - -- location of U_Ent, that's what prior defined means. + -- Otherwise location of Ent must be before the location + -- of U_Ent, that's what prior defined means. elsif Sloc (Ent) < Loc_U_Ent then return; @@ -3107,15 +3102,15 @@ package body Sem_Ch13 is when N_Unchecked_Type_Conversion => Check_Expr_Constants (Expression (Nod)); - -- If this is a rewritten unchecked conversion, subtypes - -- in this node are those created within the instance. - -- To avoid order of elaboration issues, replace them - -- with their base types. Note that address clauses can - -- cause order of elaboration problems because they are - -- elaborated by the back-end at the point of definition, - -- and may mention entities declared in between (as long - -- as everything is static). It is user-friendly to allow - -- unchecked conversions in this context. + -- If this is a rewritten unchecked conversion, subtypes in + -- this node are those created within the instance. To avoid + -- order of elaboration issues, replace them with their base + -- types. Note that address clauses can cause order of + -- elaboration problems because they are elaborated by the + -- back-end at the point of definition, and may mention + -- entities declared in between (as long as everything is + -- static). It is user-friendly to allow unchecked conversions + -- in this context. if Nkind (Original_Node (Nod)) = N_Function_Call then Set_Etype (Expression (Nod), @@ -3275,7 +3270,7 @@ package body Sem_Ch13 is if Siz < M then -- Size is less than minimum size, but one possibility remains - -- that we can manage with the new size if we bias the type + -- that we can manage with the new size if we bias the type. M := UI_From_Int (Minimum_Size (UT, Biased => True)); @@ -3347,9 +3342,8 @@ package body Sem_Ch13 is else declare Id : constant Attribute_Id := Get_Attribute_Id (Chars (N)); - begin - return Id = Attribute_Input + return Id = Attribute_Input or else Id = Attribute_Output or else Id = Attribute_Read or else Id = Attribute_Write @@ -3397,7 +3391,7 @@ package body Sem_Ch13 is -- we have short and long addresses, and it is possible for an access -- type to have a short address size (and thus be less than the size -- of System.Address itself). We simply skip the check for VMS, and - -- leave the back end to do the check. + -- leave it to the back end to do the check. elsif Is_Access_Type (T) then if OpenVMS_On_Target then @@ -3415,9 +3409,9 @@ package body Sem_Ch13 is elsif Is_Discrete_Type (T) then - -- The following loop is looking for the nearest compile time - -- known bounds following the ancestor subtype chain. The idea - -- is to find the most restrictive known bounds information. + -- The following loop is looking for the nearest compile time known + -- bounds following the ancestor subtype chain. The idea is to find + -- the most restrictive known bounds information. Ancest := T; loop @@ -3453,17 +3447,17 @@ package body Sem_Ch13 is end loop; -- Fixed-point types. We can't simply use Expr_Value to get the - -- Corresponding_Integer_Value values of the bounds, since these - -- do not get set till the type is frozen, and this routine can - -- be called before the type is frozen. Similarly the test for - -- bounds being static needs to include the case where we have - -- unanalyzed real literals for the same reason. + -- Corresponding_Integer_Value values of the bounds, since these do not + -- get set till the type is frozen, and this routine can be called + -- before the type is frozen. Similarly the test for bounds being static + -- needs to include the case where we have unanalyzed real literals for + -- the same reason. elsif Is_Fixed_Point_Type (T) then - -- The following loop is looking for the nearest compile time - -- known bounds following the ancestor subtype chain. The idea - -- is to find the most restrictive known bounds information. + -- The following loop is looking for the nearest compile time known + -- bounds following the ancestor subtype chain. The idea is to find + -- the most restrictive known bounds information. Ancest := T; loop @@ -3532,8 +3526,8 @@ package body Sem_Ch13 is end if; -- Signed case. Note that we consider types like range 1 .. -1 to be - -- signed for the purpose of computing the size, since the bounds - -- have to be accomodated in the base type. + -- signed for the purpose of computing the size, since the bounds have + -- to be accomodated in the base type. if Lo < 0 or else Hi < 0 then S := 1; @@ -3725,7 +3719,7 @@ package body Sem_Ch13 is return True; end if; - -- Otherwise check for incompleted type + -- Otherwise check for incomplete type if Is_Incomplete_Or_Private_Type (T) and then No (Underlying_Type (T)) @@ -3827,23 +3821,22 @@ package body Sem_Ch13 is if Is_Overloadable (T) and then Nkind (N) = N_Pragma - and then (Chars (N) = Name_Convention - or else - Chars (N) = Name_Import - or else - Chars (N) = Name_Export - or else - Chars (N) = Name_External - or else - Chars (N) = Name_Interface) then - null; - else - Record_Rep_Item (T, N); + declare + Pname : constant Name_Id := Pragma_Name (N); + begin + if Pname = Name_Convention or else + Pname = Name_Import or else + Pname = Name_Export or else + Pname = Name_External or else + Pname = Name_Interface + then + return False; + end if; + end; end if; - -- Rep item was OK, not too late - + Record_Rep_Item (T, N); return False; end Rep_Item_Too_Late; @@ -3919,8 +3912,8 @@ package body Sem_Ch13 is return not Has_Non_Standard_Rep (T2); end if; - -- Here the two types both have non-standard representation, and we - -- need to determine if they have the same non-standard representation + -- Here the two types both have non-standard representation, and we need + -- to determine if they have the same non-standard representation. -- For arrays, we simply need to test if the component sizes are the -- same. Pragma Pack is reflected in modified component sizes, so this @@ -4240,8 +4233,8 @@ package body Sem_Ch13 is Target := Ancestor_Subtype (Etype (Act_Unit)); - -- If either type is generic, the instantiation happens within a - -- generic unit, and there is nothing to check. The proper check + -- If either type is generic, the instantiation happens within a generic + -- unit, and there is nothing to check. The proper check -- will happen when the enclosing generic is instantiated. if Is_Generic_Type (Source) or else Is_Generic_Type (Target) then @@ -4271,8 +4264,17 @@ package body Sem_Ch13 is and then Convention (Target) /= Convention (Source) and then Warn_On_Unchecked_Conversion then - Error_Msg_N - ("?conversion between pointers with different conventions!", N); + -- Give warnings for subprogram pointers only on most targets. The + -- exception is VMS, where data pointers can have different lengths + -- depending on the pointer convention. + + if Is_Access_Subprogram_Type (Target) + or else Is_Access_Subprogram_Type (Source) + or else OpenVMS_On_Target + then + Error_Msg_N + ("?conversion between pointers with different conventions!", N); + end if; end if; -- Warn if one of the operands is Ada.Calendar.Time. Do not emit a @@ -4305,10 +4307,10 @@ package body Sem_Ch13 is end; end if; - -- Make entry in unchecked conversion table for later processing - -- by Validate_Unchecked_Conversions, which will check sizes and - -- alignments (using values set by the back-end where possible). - -- This is only done if the appropriate warning is active + -- Make entry in unchecked conversion table for later processing by + -- Validate_Unchecked_Conversions, which will check sizes and alignments + -- (using values set by the back-end where possible). This is only done + -- if the appropriate warning is active. if Warn_On_Unchecked_Conversion then Unchecked_Conversions.Append @@ -4330,10 +4332,10 @@ package body Sem_Ch13 is end if; end if; - -- If unchecked conversion to access type, and access type is - -- declared in the same unit as the unchecked conversion, then - -- set the No_Strict_Aliasing flag (no strict aliasing is - -- implicit in this situation). + -- If unchecked conversion to access type, and access type is declared + -- in the same unit as the unchecked conversion, then set the + -- No_Strict_Aliasing flag (no strict aliasing is implicit in this + -- situation). if Is_Access_Type (Target) and then In_Same_Source_Unit (Target, N) @@ -4344,7 +4346,7 @@ package body Sem_Ch13 is -- Generate N_Validate_Unchecked_Conversion node for back end in -- case the back end needs to perform special validation checks. - -- Shouldn't this be in exp_ch13, since the check only gets done + -- Shouldn't this be in Exp_Ch13, since the check only gets done -- if we have full expansion and the back end is called ??? Vnode := @@ -4352,8 +4354,8 @@ package body Sem_Ch13 is Set_Source_Type (Vnode, Source); Set_Target_Type (Vnode, Target); - -- If the unchecked conversion node is in a list, just insert before - -- it. If not we have some strange case, not worth bothering about. + -- If the unchecked conversion node is in a list, just insert before it. + -- If not we have some strange case, not worth bothering about. if Is_List_Member (N) then Insert_After (N, Vnode); @@ -4378,11 +4380,11 @@ package body Sem_Ch13 is Target_Siz : Uint; begin - -- This validation check, which warns if we have unequal sizes - -- for unchecked conversion, and thus potentially implementation + -- This validation check, which warns if we have unequal sizes for + -- unchecked conversion, and thus potentially implementation -- dependent semantics, is one of the few occasions on which we - -- use the official RM size instead of Esize. See description - -- in Einfo "Handling of Type'Size Values" for details. + -- use the official RM size instead of Esize. See description in + -- Einfo "Handling of Type'Size Values" for details. if Serious_Errors_Detected = 0 and then Known_Static_RM_Size (Source) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 920b1494040..87e256a349d 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -904,6 +904,23 @@ package body Sem_Ch3 is if Nkind (Parent (Related_Nod)) = N_Protected_Definition then Build_Itype_Reference (Anon_Type, Parent (Parent (Related_Nod))); + + -- Similarly, if the access definition is the return result of a + -- protected function, create an itype reference for it because it + -- will be used within the function body. + + elsif Nkind (Related_Nod) = N_Function_Specification + and then Ekind (Current_Scope) = E_Protected_Type + then + Build_Itype_Reference (Anon_Type, Parent (Current_Scope)); + + -- Finally, create an itype reference for an object declaration of + -- an anonymous access type. This is strictly necessary only for + -- deferred constants, but in any case will avoid out-of-scope + -- problems in the back-end. + + elsif Nkind (Related_Nod) = N_Object_Declaration then + Build_Itype_Reference (Anon_Type, Related_Nod); end if; return Anon_Type; @@ -2928,8 +2945,8 @@ package body Sem_Ch3 is -- Force generation of debugging information for the constant and for -- the renamed function call. - Set_Needs_Debug_Info (Id); - Set_Needs_Debug_Info (Entity (Prefix (E))); + Set_Debug_Info_Needed (Id); + Set_Debug_Info_Needed (Entity (Prefix (E))); end if; if Present (Prev_Entity) @@ -3213,6 +3230,7 @@ package body Sem_Ch3 is Set_Treat_As_Volatile (Id, Treat_As_Volatile (T)); Set_Is_Atomic (Id, Is_Atomic (T)); Set_Is_Ada_2005_Only (Id, Is_Ada_2005_Only (T)); + Set_Convention (Id, Convention (T)); -- In the case where there is no constraint given in the subtype -- indication, Process_Subtype just returns the Subtype_Mark, so its @@ -6633,13 +6651,13 @@ package body Sem_Ch3 is -- Fields inherited from the Parent_Type Set_Discard_Names - (Derived_Type, Einfo.Discard_Names (Parent_Type)); + (Derived_Type, Einfo.Discard_Names (Parent_Type)); Set_Has_Specified_Layout - (Derived_Type, Has_Specified_Layout (Parent_Type)); + (Derived_Type, Has_Specified_Layout (Parent_Type)); Set_Is_Limited_Composite - (Derived_Type, Is_Limited_Composite (Parent_Type)); + (Derived_Type, Is_Limited_Composite (Parent_Type)); Set_Is_Private_Composite - (Derived_Type, Is_Private_Composite (Parent_Type)); + (Derived_Type, Is_Private_Composite (Parent_Type)); -- Fields inherited from the Parent_Base @@ -6650,13 +6668,22 @@ package body Sem_Ch3 is Set_Has_Primitive_Operations (Derived_Type, Has_Primitive_Operations (Parent_Base)); - -- For non-private case, we also inherit Has_Complex_Representation + -- Fields inherited from the Parent_Base in the non-private case if Ekind (Derived_Type) = E_Record_Type then Set_Has_Complex_Representation (Derived_Type, Has_Complex_Representation (Parent_Base)); end if; + -- Fields inherited from the Parent_Base for record types + + if Is_Record_Type (Derived_Type) then + Set_OK_To_Reorder_Components + (Derived_Type, OK_To_Reorder_Components (Parent_Base)); + Set_Reverse_Bit_Order + (Derived_Type, Reverse_Bit_Order (Parent_Base)); + end if; + -- Direct controlled types do not inherit Finalize_Storage_Only flag if not Is_Controlled (Parent_Type) then @@ -7731,21 +7758,80 @@ package body Sem_Ch3 is ------------------------------- procedure Check_Abstract_Interfaces (N : Node_Id; Def : Node_Id) is + Parent_Type : constant Entity_Id := Etype (Defining_Identifier (N)); + + Iface : Node_Id; + Iface_Def : Node_Id; + Iface_Typ : Entity_Id; + Parent_Node : Node_Id; + + Is_Task : Boolean := False; + -- Set True if parent type or any progenitor is a task interface + + Is_Protected : Boolean := False; + -- Set True if parent type or any progenitor is a protected interface procedure Check_Ifaces (Iface_Def : Node_Id; Error_Node : Node_Id); - -- Local subprogram used to avoid code duplication. In case of error - -- the message will be associated to Error_Node. + -- Check that a progenitor is compatible with declaration. + -- Error is posted on Error_Node. ------------------ -- Check_Ifaces -- ------------------ procedure Check_Ifaces (Iface_Def : Node_Id; Error_Node : Node_Id) is + Iface_Id : constant Entity_Id := + Defining_Identifier (Parent (Iface_Def)); + Type_Def : Node_Id; + begin - -- Ada 2005 (AI-345): Protected interfaces can only inherit from - -- limited, synchronized or protected interfaces. + if Nkind (N) = N_Private_Extension_Declaration then + Type_Def := N; + else + Type_Def := Type_Definition (N); + end if; - if Protected_Present (Def) then + if Is_Task_Interface (Iface_Id) then + Is_Task := True; + + elsif Is_Protected_Interface (Iface_Id) then + Is_Protected := True; + end if; + + -- Check that the characteristics of the progenitor are compatible + -- with the explicit qualifier in the declaration. + -- The check only applies to qualifiers that come from source. + -- Limited_Present also appears in the declaration of corresponding + -- records, and the check does not apply to them. + + if Limited_Present (Type_Def) + and then not + Is_Concurrent_Record_Type (Defining_Identifier (N)) + then + if Is_Limited_Interface (Parent_Type) + and then not Is_Limited_Interface (Iface_Id) + then + Error_Msg_NE + ("progenitor& must be limited interface", + Error_Node, Iface_Id); + + elsif + (Task_Present (Iface_Def) + or else Protected_Present (Iface_Def) + or else Synchronized_Present (Iface_Def)) + and then Nkind (N) /= N_Private_Extension_Declaration + then + Error_Msg_NE + ("progenitor& must be limited interface", + Error_Node, Iface_Id); + end if; + + -- Protected interfaces can only inherit from limited, synchronized + -- or protected interfaces. + + elsif Nkind (N) = N_Full_Type_Declaration + and then Protected_Present (Type_Def) + then if Limited_Present (Iface_Def) or else Synchronized_Present (Iface_Def) or else Protected_Present (Iface_Def) @@ -7764,21 +7850,25 @@ package body Sem_Ch3 is -- Ada 2005 (AI-345): Synchronized interfaces can only inherit from -- limited and synchronized. - elsif Synchronized_Present (Def) then + elsif Synchronized_Present (Type_Def) then if Limited_Present (Iface_Def) or else Synchronized_Present (Iface_Def) then null; - elsif Protected_Present (Iface_Def) then + elsif Protected_Present (Iface_Def) + and then Nkind (N) /= N_Private_Extension_Declaration + then Error_Msg_N ("(Ada 2005) synchronized interface cannot inherit" & " from protected interface", Error_Node); - elsif Task_Present (Iface_Def) then + elsif Task_Present (Iface_Def) + and then Nkind (N) /= N_Private_Extension_Declaration + then Error_Msg_N ("(Ada 2005) synchronized interface cannot inherit" & " from task interface", Error_Node); - else + elsif not Is_Limited_Interface (Iface_Id) then Error_Msg_N ("(Ada 2005) synchronized interface cannot inherit" & " from non-limited interface", Error_Node); end if; @@ -7786,7 +7876,9 @@ package body Sem_Ch3 is -- Ada 2005 (AI-345): Task interfaces can only inherit from limited, -- synchronized or task interfaces. - elsif Task_Present (Def) then + elsif Nkind (N) = N_Full_Type_Declaration + and then Task_Present (Type_Def) + then if Limited_Present (Iface_Def) or else Synchronized_Present (Iface_Def) or else Task_Present (Iface_Def) @@ -7804,28 +7896,57 @@ package body Sem_Ch3 is end if; end Check_Ifaces; - -- Local variables - - Iface : Node_Id; - Iface_Def : Node_Id; - Iface_Typ : Entity_Id; - Parent_Node : Node_Id; - -- Start of processing for Check_Abstract_Interfaces begin - -- Why is this still unsupported??? + if Is_Interface (Parent_Type) then + if Is_Task_Interface (Parent_Type) then + Is_Task := True; + + elsif Is_Protected_Interface (Parent_Type) then + Is_Protected := True; + end if; + end if; if Nkind (N) = N_Private_Extension_Declaration then + + -- Check that progenitors are compatible with declaration + + Iface := First (Interface_List (Def)); + while Present (Iface) loop + Iface_Typ := Find_Type_Of_Subtype_Indic (Iface); + + Parent_Node := Parent (Base_Type (Iface_Typ)); + Iface_Def := Type_Definition (Parent_Node); + + if not Is_Interface (Iface_Typ) then + Error_Msg_NE ("(Ada 2005) & must be an interface", + Iface, Iface_Typ); + + else + Check_Ifaces (Iface_Def, Iface); + end if; + + Next (Iface); + end loop; + + if Is_Task and Is_Protected then + Error_Msg_N + ("type cannot derive from task and protected interface", N); + end if; + return; end if; - -- Check the parent in case of derivation of interface type + -- Full type declaration of derived type. + -- Check compatibility with parent if it is interface type if Nkind (Type_Definition (N)) = N_Derived_Type_Definition - and then Is_Interface (Etype (Defining_Identifier (N))) + and then Is_Interface (Parent_Type) then - Parent_Node := Parent (Etype (Defining_Identifier (N))); + Parent_Node := Parent (Parent_Type); + + -- More detailed checks for interface varieties Check_Ifaces (Iface_Def => Type_Definition (Parent_Node), @@ -7833,6 +7954,7 @@ package body Sem_Ch3 is end if; Iface := First (Interface_List (Def)); + while Present (Iface) loop Iface_Typ := Find_Type_Of_Subtype_Indic (Iface); @@ -7853,6 +7975,12 @@ package body Sem_Ch3 is Next (Iface); end loop; + + if Is_Task and Is_Protected then + Error_Msg_N + ("type cannot derive from task and protected interface", N); + end if; + end Check_Abstract_Interfaces; ------------------------------- @@ -14002,6 +14130,13 @@ package body Sem_Ch3 is T := Standard_Character; end if; + -- The node may be overloaded because some user-defined operators + -- are available, but if a universal interpretation exists it is + -- also the selected one. + + elsif Universal_Interpretation (I) = Universal_Integer then + T := Standard_Integer; + else T := Any_Type; diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 49a1699be51..e3d45f9e942 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -356,7 +356,12 @@ package body Sem_Ch4 is Type_Id : Entity_Id; begin - Check_Restriction (No_Allocators, N); + -- In accordance with H.4(7), the No_Allocators restriction only applies + -- to user-written allocators. + + if Comes_From_Source (N) then + Check_Restriction (No_Allocators, N); + end if; if Nkind (E) = N_Qualified_Expression then Acc_Type := Create_Itype (E_Allocator_Type, N); @@ -3811,6 +3816,10 @@ package body Sem_Ch4 is -- predefined operator. Used to implement Ada 2005 AI-264, to make -- such operators more visible and therefore useful. + -- If the name of the operation is an expanded name with prefix + -- Standard, the predefined universal fixed operator is available, + -- as specified by AI-420 (RM 4.5.5 (19.1/2)). + function Specific_Type (T1, T2 : Entity_Id) return Entity_Id; -- Get specific type (i.e. non-universal type if there is one) @@ -3825,6 +3834,16 @@ package body Sem_Ch4 is F2 : Entity_Id; begin + -- If the universal_fixed operation is given explicitly the rule + -- concerning primitive operations of the type do not apply. + + if Nkind (N) = N_Function_Call + and then Nkind (Name (N)) = N_Expanded_Name + and then Entity (Prefix (Name (N))) = Standard_Standard + then + return False; + end if; + -- The operation is treated as primitive if it is declared in the -- same scope as the type, and therefore on the same entity chain. diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 9aaa37f9fb4..8c038658c54 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1260,6 +1260,13 @@ package body Sem_Ch6 is -- when the subprogram has a body that acts as spec. This is done for -- some cases of inlining, and for private protected ops. + procedure Set_Trivial_Subprogram (N : Node_Id); + -- Sets the Is_Trivial_Subprogram flag in both spec and body of the + -- subprogram whose body is being analyzed. N is the statement node + -- causing the flag to be set, if the following statement is a return + -- of an entity, we mark the entity as set in source to suppress any + -- warning on the stylized use of function stubs with a dummy return. + procedure Verify_Overriding_Indicator; -- If there was a previous spec, the entity has been entered in the -- current scope previously. If the body itself carries an overriding @@ -1329,10 +1336,10 @@ package body Sem_Ch6 is if Nkind (Prag) = N_Pragma and then - (Get_Pragma_Id (Chars (Prag)) = Pragma_Inline_Always - or else + (Pragma_Name (Prag) = Name_Inline_Always + or else (Front_End_Inlining - and then Get_Pragma_Id (Chars (Prag)) = Pragma_Inline)) + and then Pragma_Name (Prag) = Name_Inline)) and then Chars (Expression (First (Pragma_Argument_Associations (Prag)))) @@ -1378,7 +1385,7 @@ package body Sem_Ch6 is Analyze (Prag); Set_Has_Pragma_Inline (Subp); - if Get_Pragma_Id (Chars (Prag)) = Pragma_Inline_Always then + if Pragma_Name (Prag) = Name_Inline_Always then Set_Is_Inlined (Subp); Set_Next_Rep_Item (Prag, First_Rep_Item (Subp)); Set_First_Rep_Item (Subp, Prag); @@ -1418,6 +1425,30 @@ package body Sem_Ch6 is end loop; end Copy_Parameter_List; + ---------------------------- + -- Set_Trivial_Subprogram -- + ---------------------------- + + procedure Set_Trivial_Subprogram (N : Node_Id) is + Nxt : constant Node_Id := Next (N); + + begin + Set_Is_Trivial_Subprogram (Body_Id); + + if Present (Spec_Id) then + Set_Is_Trivial_Subprogram (Spec_Id); + end if; + + if Present (Nxt) + and then Nkind (Nxt) = N_Simple_Return_Statement + and then No (Next (Nxt)) + and then Present (Expression (Nxt)) + and then Is_Entity_Name (Expression (Nxt)) + then + Set_Never_Set_In_Source (Entity (Expression (Nxt)), False); + end if; + end Set_Trivial_Subprogram; + --------------------------------- -- Verify_Overriding_Indicator -- --------------------------------- @@ -1434,7 +1465,7 @@ package body Sem_Ch6 is if Is_Overriding_Operation (Spec_Id) then Error_Msg_NE ("subprogram& overrides inherited operation", - Body_Spec, Spec_Id); + Body_Spec, Spec_Id); -- If this is not a primitive operation the overriding indicator -- is altogether illegal. @@ -1519,8 +1550,7 @@ package body Sem_Ch6 is -- subprogram will get frozen too late (there may be code within -- the body that depends on the subprogram having been frozen, -- such as uses of extra formals), so we force it to be frozen - -- here. Same holds if the body and the spec are compilation - -- units. + -- here. Same holds if the body and spec are compilation units. if No (Spec_Id) then Freeze_Before (N, Body_Id); @@ -1710,10 +1740,11 @@ package body Sem_Ch6 is N_Subprogram_Renaming_Declaration)) then Conformant := True; + else Check_Conformance (Body_Id, Spec_Id, - Fully_Conformant, True, Conformant, Body_Id); + Fully_Conformant, True, Conformant, Body_Id); end if; -- If the body is not fully conformant, we have to decide if we @@ -1777,8 +1808,7 @@ package body Sem_Ch6 is end; end if; - -- Now make the formals visible, and place subprogram - -- on scope stack. + -- Make the formals visible, and place subprogram on scope stack Install_Formals (Spec_Id); Last_Formal := Last_Entity (Spec_Id); @@ -1820,65 +1850,18 @@ package body Sem_Ch6 is end if; end if; - -- Ada 2005 (AI-251): Check wrong placement of abstract interface - -- primitives, and update anonymous access returns with limited views. + -- If the return type is an anonymous access type whose designated type + -- is the limited view of a class-wide type and the non-limited view is + -- available, update the return type accordingly. if Ada_Version >= Ada_05 and then Comes_From_Source (N) then declare - E : Entity_Id; Etyp : Entity_Id; Rtyp : Entity_Id; begin - -- Check the type of the formals - - E := First_Entity (Body_Id); - while Present (E) loop - Etyp := Etype (E); - - if Is_Access_Type (Etyp) then - Etyp := Directly_Designated_Type (Etyp); - end if; - - if not Is_Class_Wide_Type (Etyp) - and then Is_Interface (Etyp) - then - Error_Msg_Name_1 := Chars (Defining_Entity (N)); - Error_Msg_N - ("(Ada 2005) abstract interface primitives must be" & - " defined in package specs", N); - exit; - end if; - - Next_Entity (E); - end loop; - - -- In case of functions, check the type of the result - - if Ekind (Body_Id) = E_Function then - Etyp := Etype (Body_Id); - - if Is_Access_Type (Etyp) then - Etyp := Directly_Designated_Type (Etyp); - end if; - - if not Is_Class_Wide_Type (Etyp) - and then Is_Interface (Etyp) - then - Error_Msg_Name_1 := Chars (Defining_Entity (N)); - Error_Msg_N - ("(Ada 2005) abstract interface primitives must be" & - " defined in package specs", N); - end if; - end if; - - -- If the return type is an anonymous access type whose - -- designated type is the limited view of a class-wide type - -- and the non-limited view is available. update the return - -- type accordingly. - Rtyp := Etype (Current_Scope); if Ekind (Rtyp) = E_Anonymous_Access_Type then @@ -2069,7 +2052,12 @@ package body Sem_Ch6 is end if; -- Now we are going to check for variables that are never modified in - -- the body of the procedure. We omit these checks if the first + -- the body of the procedure. But first we deal with a special case + -- where we want to modify this check. If the body of the subprogram + -- starts with a raise statement or its equivalent, or if the body + -- consists entirely of a null statement, then it is pretty obvious + -- that it is OK to not reference the parameters. For example, this + -- might be the following common idiom for a stubbed function: -- statement of the procedure raises an exception. In particular this -- deals with the common idiom of a stubbed function, which might -- appear as something like @@ -2081,10 +2069,17 @@ package body Sem_Ch6 is -- return X; -- end F; - -- Here the purpose of X is simply to satisfy the (annoying) - -- requirement in Ada that there be at least one return, and we - -- certainly do not want to go posting warnings on X that it is not - -- initialized! + -- Here the purpose of X is simply to satisfy the annoying requirement + -- in Ada that there be at least one return, and we certainly do not + -- want to go posting warnings on X that it is not initialized! On + -- the other hand, if X is entirely unreferenced that should still + -- get a warning. + + -- What we do is to detect these cases, and if we find them, flag the + -- subprogram as being Is_Trivial_Subprogram and then use that flag to + -- suppress unwanted warnings. For the case of the function stub above + -- we have a special test to set X as apparently assigned to suppress + -- the warning. declare Stm : Node_Id; @@ -2107,10 +2102,18 @@ package body Sem_Ch6 is Ostm : constant Node_Id := Original_Node (Stm); begin - -- If explicit raise statement, return with no checks + -- If explicit raise statement, turn on flag if Nkind (Ostm) = N_Raise_Statement then - return; + Set_Trivial_Subprogram (Stm); + + -- If null statement, and no following statemennts, turn on flag + + elsif Nkind (Stm) = N_Null_Statement + and then Comes_From_Source (Stm) + and then No (Next (Stm)) + then + Set_Trivial_Subprogram (Stm); -- Check for explicit call cases which likely raise an exception @@ -2122,22 +2125,23 @@ package body Sem_Ch6 is begin -- If the procedure is marked No_Return, then likely it -- raises an exception, but in any case it is not coming - -- back here, so no need to check beyond the call. + -- back here, so turn on the flag. if Ekind (Ent) = E_Procedure and then No_Return (Ent) then - return; + Set_Trivial_Subprogram (Stm); -- If the procedure name is Raise_Exception, then also -- assume that it raises an exception. The main target -- here is Ada.Exceptions.Raise_Exception, but this name -- is pretty evocative in any context! Note that the -- procedure in Ada.Exceptions is not marked No_Return - -- because of the annoying case of the null exception Id. + -- because of the annoying case of the null exception Id + -- when operating in Ada 95 mode. elsif Chars (Ent) = Name_Raise_Exception then - return; + Set_Trivial_Subprogram (Stm); end if; end; end if; @@ -2453,10 +2457,10 @@ package body Sem_Ch6 is -- variable as is done for other inlined calls. procedure Remove_Pragmas; - -- A pragma Unreferenced that mentions a formal parameter has no meaning - -- when the body is inlined and the formals are rewritten. Remove it - -- from body to inline. The analysis of the non-inlined body will handle - -- the pragma properly. + -- A pragma Unreferenced or pragma Unmodified that mentions a formal + -- parameter has no meaning when the body is inlined and the formals + -- are rewritten. Remove it from body to inline. The analysis of the + -- non-inlined body will handle the pragma properly. function Uses_Secondary_Stack (Bod : Node_Id) return Boolean; -- If the body of the subprogram includes a call that returns an @@ -2709,7 +2713,9 @@ package body Sem_Ch6 is Nxt := Next (Decl); if Nkind (Decl) = N_Pragma - and then Chars (Decl) = Name_Unreferenced + and then (Pragma_Name (Decl) = Name_Unreferenced + or else + Pragma_Name (Decl) = Name_Unmodified) then Remove (Decl); end if; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 11f24ce3c6c..2e95a1f5f43 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -939,6 +939,7 @@ package body Sem_Ch7 is Inst_Par := Inst_Id; Gen_Par := Generic_Parent (Specification (Unit_Declaration_Node (Inst_Par))); + while Present (Gen_Par) and then Is_Child_Unit (Gen_Par) loop Inst_Node := Get_Package_Instantiation_Node (Inst_Par); @@ -963,11 +964,18 @@ package body Sem_Ch7 is -- happens when a generic child is instantiated, and the -- instance is a child of the parent instance. - -- Installing the use clauses of the parent instance twice is - -- both unnecessary and wrong, because it would cause the - -- clauses to be chained to themselves in the use clauses list - -- of the scope stack entry. That in turn would cause - -- End_Use_Clauses to get into an endless look upon scope exit. + -- Installing the use clauses of the parent instance twice + -- is both unnecessary and wrong, because it would cause the + -- clauses to be chained to themselves in the use clauses + -- list of the scope stack entry. That in turn would cause + -- an endless loop from End_Use_Clauses upon sccope exit. + + -- The parent is now fully visible. It may be a hidden open + -- scope if we are currently compiling some child instance + -- declared within it, but while the current instance is being + -- compiled the parent is immediately visible. In particular + -- its entities must remain visible if a stack save/restore + -- takes place through a call to Rtsfind. if Present (Gen_Par) then if not In_Private_Part (Inst_Par) then @@ -975,6 +983,7 @@ package body Sem_Ch7 is Set_Use (Private_Declarations (Specification (Unit_Declaration_Node (Inst_Par)))); + Set_Is_Hidden_Open_Scope (Inst_Par, False); end if; -- If we've reached the end of the generic instance parents, diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 609f5575320..b732d507ab9 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -747,6 +747,19 @@ package body Sem_Ch8 is Resolve (Nam, T); + -- Check that a class-wide object is not being renamed as an object + -- of a specific type. The test for access types is needed to exclude + -- cases where the renamed object is a dynamically tagged access + -- result, such as occurs in certain expansions. + + if (Is_Class_Wide_Type (Etype (Nam)) + or else (Is_Dynamically_Tagged (Nam) + and then not Is_Access_Type (T))) + and then not Is_Class_Wide_Type (T) + then + Error_Msg_N ("dynamically tagged expression not allowed!", Nam); + end if; + -- Ada 2005 (AI-230/AI-254): Access renaming else pragma Assert (Present (Access_Definition (N))); @@ -1046,7 +1059,7 @@ package body Sem_Ch8 is Generate_Reference (Old_P, Name (N)); -- If the renaming is in the visible part of a package, then we set - -- In_Package_Spec for the renamed package, to prevent giving + -- Renamed_In_Spec for the renamed package, to prevent giving -- warnings about no entities referenced. Such a warning would be -- overenthusiastic, since clients can see entities in the renamed -- package via the visible package renaming. @@ -6583,6 +6596,13 @@ package body Sem_Ch8 is then Full_Vis := True; + -- if S is the scope of some instance (which has already been + -- seen on the stack) it does not affect the visibility of + -- other scopes. + + elsif Is_Hidden_Open_Scope (S) then + null; + elsif (Ekind (S) = E_Procedure or else Ekind (S) = E_Function) and then Has_Completion (S) diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 0f3f57becab..1652a82fc67 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -641,7 +641,10 @@ package body Sem_Disp is begin E := First_Entity (Subp); while Present (E) loop - if Is_Access_Type (Etype (E)) then + + -- For an access parameter, check designated type. + + if Ekind (Etype (E)) = E_Anonymous_Access_Type then Typ := Designated_Type (Etype (E)); else Typ := Etype (E); diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index e3bd6897a1c..922a16d53ae 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1654,12 +1654,6 @@ package body Sem_Elab is return; end if; - -- All OK if warnings suppressed on the entity - - if Warnings_Off (Ent) then - return; - end if; - -- All OK if all warnings suppressed if Warning_Mode = Suppress then @@ -1691,16 +1685,20 @@ package body Sem_Elab is -- Here is where we give the warning - Error_Msg_Sloc := Sloc (Ent); + -- All OK if warnings suppressed on the entity - Error_Msg_NE - ("?elaboration code may access& before it is initialized", - N, Ent); - Error_Msg_NE - ("\?suggest adding pragma Elaborate_Body to spec of &", - N, Scop); - Error_Msg_N - ("\?or an explicit initialization could be added #", N); + if not Has_Warnings_Off (Ent) then + Error_Msg_Sloc := Sloc (Ent); + + Error_Msg_NE + ("?elaboration code may access& before it is initialized", + N, Ent); + Error_Msg_NE + ("\?suggest adding pragma Elaborate_Body to spec of &", + N, Scop); + Error_Msg_N + ("\?or an explicit initialization could be added #", N); + end if; if not All_Errors_Mode then Set_Suppress_Elaboration_Warnings (Ent); @@ -3109,7 +3107,7 @@ package body Sem_Elab is Item := First (Context_Items (Cunit (Current_Sem_Unit))); while Present (Item) loop if Nkind (Item) = N_Pragma - and then Get_Pragma_Id (Chars (Item)) = Pragma_Elaborate_All + and then Pragma_Name (Item) = Name_Elaborate_All then -- Return if some previous error on the pragma itself diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index f0f31cbb629..251805ddf8e 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -75,6 +75,7 @@ with Targparm; use Targparm; with Tbuild; use Tbuild; with Ttypes; with Uintp; use Uintp; +with Uname; use Uname; with Urealp; use Urealp; with Validsw; use Validsw; @@ -235,6 +236,7 @@ package body Sem_Prag is procedure Analyze_Pragma (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); + Pname : constant Name_Id := Pragma_Name (N); Prag_Id : Pragma_Id; Pragma_Exit : exception; @@ -502,7 +504,7 @@ package body Sem_Prag is function Is_Configuration_Pragma return Boolean; -- Deterermines if the placement of the current pragma is appropriate - -- for a configuration pragma (precedes the current compilation unit). + -- for a configuration pragma. function Is_In_Context_Clause return Boolean; -- Returns True if pragma appears within the context clause of a unit, @@ -715,7 +717,7 @@ package body Sem_Prag is -- Here we have a real error (non-static expression) else - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Flag_Non_Static_Expr ("argument for pragma% must be a identifier or " & "static string expression!", Argx); @@ -909,7 +911,7 @@ package body Sem_Prag is -- Finally, we have a real error else - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Flag_Non_Static_Expr ("argument for pragma% must be a static expression!", Argx); raise Pragma_Exit; @@ -962,7 +964,7 @@ package body Sem_Prag is for K in Names'Range loop if Chars (Arg) = Names (K) then if K < Highest_So_Far then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("parameters out of order for pragma%", Arg); Error_Msg_Name_1 := Names (K); @@ -1112,7 +1114,7 @@ package body Sem_Prag is elsif Present (Parameter_Specifications (Specification (P))) or else not Is_Compilation_Unit (Defining_Entity (P)) then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("?pragma% is only effective in main program", N); end if; @@ -1239,7 +1241,7 @@ package body Sem_Prag is begin if Present (Arg) and then Chars (Arg) /= No_Name then if Chars (Arg) /= Id then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_Name_2 := Id; Error_Msg_N ("pragma% argument expects identifier%", Arg); raise Pragma_Exit; @@ -1319,9 +1321,9 @@ package body Sem_Prag is -- Check_Valid_Configuration_Pragma -- -------------------------------------- - -- A configuration pragma must appear in the context clause of - -- a compilation unit, at the start of the list (i.e. only other - -- pragmas may precede it). + -- A configuration pragma must appear in the context clause of a + -- compilation unit, and only other pragmas may preceed it. Note that + -- the test also allows use in a configuration pragma file. procedure Check_Valid_Configuration_Pragma is begin @@ -1500,7 +1502,7 @@ package body Sem_Prag is procedure Error_Pragma (Msg : String) is begin - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N (Msg, N); raise Pragma_Exit; end Error_Pragma; @@ -1511,14 +1513,14 @@ package body Sem_Prag is procedure Error_Pragma_Arg (Msg : String; Arg : Node_Id) is begin - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N (Msg, Get_Pragma_Arg (Arg)); raise Pragma_Exit; end Error_Pragma_Arg; procedure Error_Pragma_Arg (Msg1, Msg2 : String; Arg : Node_Id) is begin - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N (Msg1, Get_Pragma_Arg (Arg)); Error_Pragma_Arg (Msg2, Arg); end Error_Pragma_Arg; @@ -1529,7 +1531,7 @@ package body Sem_Prag is procedure Error_Pragma_Arg_Ident (Msg : String; Arg : Node_Id) is begin - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N (Msg, Arg); raise Pragma_Exit; end Error_Pragma_Arg_Ident; @@ -1717,7 +1719,7 @@ package body Sem_Prag is end if; if Index = Names'Last then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("pragma% does not allow & argument", Arg); -- Check for possible misspelling @@ -1792,9 +1794,9 @@ package body Sem_Prag is -- Is_Configuration_Pragma -- ----------------------------- - -- A configuration pragma must appear in the context clause of - -- a compilation unit, at the start of the list (i.e. only other - -- pragmas may precede it). + -- A configuration pragma must appear in the context clause of a + -- compilation unit, and only other pragmas may precede it. Note that + -- the test below also permits use in a configuration pragma file. function Is_Configuration_Pragma return Boolean is Lis : constant List_Id := List_Containing (N); @@ -2029,15 +2031,27 @@ package body Sem_Prag is Ptr : Nat; CC : Char_Code; C : Character; + Cent : constant Entity_Id := + Cunit_Entity (Current_Sem_Unit); + + Force : constant Boolean := + Prag_Id = Pragma_Compile_Time_Warning + and then + Is_Spec_Name (Unit_Name (Current_Sem_Unit)) + and then (Ekind (Cent) /= E_Package + or else not In_Private_Part (Cent)); + -- Set True if this is the warning case, and we are in the + -- visible part of a package spec, or in a subprogram spec, + -- in which case we want to force the client to see the + -- warning, even though it is not in the main unit. begin - Cont := False; - Ptr := 1; - -- Loop through segments of message separated by line -- feeds. We output these segments as separate messages -- with continuation marks for all but the first. + Cont := False; + Ptr := 1; loop Error_Msg_Strlen := 0; @@ -2063,11 +2077,33 @@ package body Sem_Prag is Error_Msg_Warn := Prag_Id = Pragma_Compile_Time_Warning; - if Cont = False then - Error_Msg_N ("<~", Arg1); - Cont := True; + -- If this is a warning in a spec, then we want clients + -- to see the warning, so mark the message with the + -- special sequence !! to force the warning. In the case + -- of a package spec, we do not force this if we are in + -- the private part of the spec. + + if Force then + if Cont = False then + Error_Msg_N ("<~!!", Arg1); + Cont := True; + else + Error_Msg_N ("\<~!!", Arg1); + end if; + + -- Error, rather than warning, or in a body, so we do not + -- need to force visibility for client (error will be + -- output in any case, and this is the situation in which + -- we do not want a client to get a warning, since the + -- warning is in the body or the spec private part. + else - Error_Msg_N ("\<~", Arg1); + if Cont = False then + Error_Msg_N ("<~", Arg1); + Cont := True; + else + Error_Msg_N ("\<~", Arg1); + end if; end if; exit when Ptr > Len; @@ -2253,7 +2289,7 @@ package body Sem_Prag is or else Ekind (E) = E_Named_Real then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("cannot apply pragma% to named constant!", Get_Pragma_Arg (Arg2)); @@ -2713,8 +2749,9 @@ package body Sem_Prag is elsif Etype (Def_Id) /= Standard_Void_Type and then - (Chars (N) = Name_Export_Procedure - or else Chars (N) = Name_Import_Procedure) + (Pname = Name_Export_Procedure + or else + Pname = Name_Import_Procedure) then Match := False; @@ -2792,7 +2829,7 @@ package body Sem_Prag is else if not Ambiguous then Ambiguous := True; - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("pragma% does not uniquely identify subprogram!", N); @@ -4289,7 +4326,7 @@ package body Sem_Prag is Error_Msg_NE ("entity& was previously imported", N, E); end if; - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("\(pragma% applies to all previous entities)", N); @@ -4525,13 +4562,13 @@ package body Sem_Prag is begin -- Deal with unrecognized pragma - if not Is_Pragma_Name (Chars (N)) then + if not Is_Pragma_Name (Pname) then if Warn_On_Unrecognized_Pragma then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("?unrecognized pragma%!", Pragma_Identifier (N)); for PN in First_Pragma_Name .. Last_Pragma_Name loop - if Is_Bad_Spelling_Of (Chars (N), PN) then + if Is_Bad_Spelling_Of (Pname, PN) then Error_Msg_Name_1 := PN; Error_Msg_N ("\?possible misspelling of %!", Pragma_Identifier (N)); @@ -4545,7 +4582,7 @@ package body Sem_Prag is -- Here to start processing for recognized pragma - Prag_Id := Get_Pragma_Id (Chars (N)); + Prag_Id := Get_Pragma_Id (Pname); -- Preset arguments @@ -6647,7 +6684,7 @@ package body Sem_Prag is -- If it's an access-to-subprogram type (in particular, not a -- subtype), set the flag on that type. - if Ekind (Named_Entity) in Access_Subprogram_Type_Kind then + if Is_Access_Subprogram_Type (Named_Entity) then Set_Can_Use_Internal_Rep (Named_Entity, False); -- Otherwise it's an error (name denotes the wrong sort of entity) @@ -7419,7 +7456,8 @@ package body Sem_Prag is if Is_Imported (Def_Id) and then Present (First_Rep_Item (Def_Id)) and then Nkind (First_Rep_Item (Def_Id)) = N_Pragma - and then Chars (First_Rep_Item (Def_Id)) = Name_Interface + and then + Pragma_Name (First_Rep_Item (Def_Id)) = Name_Interface then null; else @@ -8251,9 +8289,9 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Chars (Nod) = Name_Main + and then Pragma_Name (Nod) = Name_Main then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); end if; @@ -8295,9 +8333,9 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Chars (Nod) = Name_Main_Storage + and then Pragma_Name (Nod) = Name_Main_Storage then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); end if; @@ -8684,7 +8722,7 @@ package body Sem_Prag is -- Optimize -- -------------- - -- pragma Optimize (Time | Space); + -- pragma Optimize (Time | Space | Off); -- The actual check for optimize is done in Gigi. Note that this -- pragma does not actually change the optimization setting, it @@ -8695,6 +8733,33 @@ package body Sem_Prag is Check_Arg_Count (1); Check_Arg_Is_One_Of (Arg1, Name_Time, Name_Space, Name_Off); + ------------------------ + -- Optimize_Alignment -- + ------------------------ + + -- pragma Optimize_Alignment (Time | Space | Off); + + when Pragma_Optimize_Alignment => + GNAT_Pragma; + Check_No_Identifiers; + Check_Arg_Count (1); + Check_Valid_Configuration_Pragma; + + declare + Nam : constant Name_Id := Chars (Get_Pragma_Arg (Arg1)); + begin + case Nam is + when Name_Time => + Opt.Optimize_Alignment := 'T'; + when Name_Space => + Opt.Optimize_Alignment := 'S'; + when Name_Off => + Opt.Optimize_Alignment := 'O'; + when others => + Error_Pragma_Arg ("invalid argument for pragma%", Arg1); + end case; + end; + ---------- -- Pack -- ---------- @@ -10508,9 +10573,9 @@ package body Sem_Prag is Nod := Next (N); while Present (Nod) loop if Nkind (Nod) = N_Pragma - and then Chars (Nod) = Name_Time_Slice + and then Pragma_Name (Nod) = Name_Time_Slice then - Error_Msg_Name_1 := Chars (N); + Error_Msg_Name_1 := Pname; Error_Msg_N ("duplicate pragma% not permitted", Nod); end if; @@ -11165,6 +11230,12 @@ package body Sem_Prag is Set_Warnings_Off (E, (Chars (Expression (Arg1)) = Name_Off)); + if Chars (Expression (Arg1)) = Name_Off + and then Warn_On_Warnings_Off + then + Warnings_Off_Pragmas.Append ((N, E)); + end if; + if Is_Enumeration_Type (E) then declare Lit : Entity_Id; @@ -11296,9 +11367,9 @@ package body Sem_Prag is function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean is begin - return Chars (N) = Name_Interrupt_State + return Pragma_Name (N) = Name_Interrupt_State or else - Chars (N) = Name_Priority_Specific_Dispatching; + Pragma_Name (N) = Name_Priority_Specific_Dispatching; end Delay_Config_Pragma_Analyze; ------------------------- @@ -11496,6 +11567,7 @@ package body Sem_Prag is Pragma_Normalize_Scalars => -1, Pragma_Obsolescent => 0, Pragma_Optimize => -1, + Pragma_Optimize_Alignment => -1, Pragma_Pack => 0, Pragma_Page => -1, Pragma_Passive => -1, @@ -11575,7 +11647,7 @@ package body Sem_Prag is return False; else - C := Sig_Flags (Get_Pragma_Id (Chars (Parent (P)))); + C := Sig_Flags (Get_Pragma_Id (Parent (P))); case C is when -1 => @@ -11612,7 +11684,7 @@ package body Sem_Prag is function Is_Pragma_String_Literal (Par : Node_Id) return Boolean is Pragn : constant Node_Id := Parent (Par); Assoc : constant List_Id := Pragma_Argument_Associations (Pragn); - Pname : constant Name_Id := Chars (Pragn); + Pname : constant Name_Id := Pragma_Name (Pragn); Argn : Natural; N : Node_Id; @@ -11686,7 +11758,7 @@ package body Sem_Prag is if Present (PA) then P := First (PA); while Present (P) loop - if Chars (P) = Name_Suppress_All then + if Pragma_Name (P) = Name_Suppress_All then Prepend_To (Context_Items (N), Make_Pragma (Sloc (P), Chars => Name_Suppress, diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index a741c467648..9e8687daad6 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -720,8 +720,34 @@ package body Sem_Res is -- Start of processing for Check_Infinite_Recursion begin - -- Loop moving up tree, quitting if something tells us we are - -- definitely not in an infinite recursion situation. + -- Special case, if this is a procedure call and is a call to the + -- current procedure with the same argument list, then this is for + -- sure an infinite recursion and we insert a call to raise SE. + + if Is_List_Member (N) + and then List_Length (List_Containing (N)) = 1 + and then Same_Argument_List + then + declare + P : constant Node_Id := Parent (N); + begin + if Nkind (P) = N_Handled_Sequence_Of_Statements + and then Nkind (Parent (P)) = N_Subprogram_Body + and then Is_Empty_List (Declarations (Parent (P))) + then + Error_Msg_N ("!?infinite recursion", N); + Error_Msg_N ("\!?Storage_Error will be raised at run time", N); + Insert_Action (N, + Make_Raise_Storage_Error (Sloc (N), + Reason => SE_Infinite_Recursion)); + return True; + end if; + end; + end if; + + -- If not that special case, search up tree, quitting if we reach a + -- construct (e.g. a conditional) that tells us that this is not a + -- case for an infinite recursion warning. C := N; loop @@ -738,10 +764,10 @@ package body Sem_Res is elsif Nkind (P) = N_Handled_Sequence_Of_Statements and then C /= First (Statements (P)) then - -- If the call is the expression of a return statement and - -- the actuals are identical to the formals, it's worth a - -- warning. However, we skip this if there is an immediately - -- preceding raise statement, since the call is never executed. + -- If the call is the expression of a return statement and the + -- actuals are identical to the formals, it's worth a warning. + -- However, we skip this if there is an immediately preceding + -- raise statement, since the call is never executed. -- Furthermore, this corresponds to a common idiom: @@ -3045,6 +3071,21 @@ package body Sem_Res is A_Typ := Etype (A); F_Typ := Etype (F); + -- For mode IN, if actual is an entity, and the type of the formal + -- has warnings suppressed, then we reset Never_Set_In_Source for + -- the calling entity. The reason for this is to catch cases like + -- GNAT.Spitbol.Patterns.Vstring_Var where the called subprogram + -- uses trickery to modify an IN parameter. + + if Ekind (F) = E_In_Parameter + and then Is_Entity_Name (A) + and then Present (Entity (A)) + and then Ekind (Entity (A)) = E_Variable + and then Has_Warnings_Off (F_Typ) + then + Set_Never_Set_In_Source (Entity (A), False); + end if; + -- Perform error checks for IN and IN OUT parameters if Ekind (F) /= E_Out_Parameter then @@ -4625,17 +4666,23 @@ package body Sem_Res is if Comes_From_Source (N) then Scop := Current_Scope; + -- Issue warning for possible infinite recursion in the absence + -- of the No_Recursion restriction. + if Nam = Scop and then not Restriction_Active (No_Recursion) and then Check_Infinite_Recursion (N) then -- Here we detected and flagged an infinite recursion, so we do - -- not need to test the case below for further warnings. + -- not need to test the case below for further warnings. Also if + -- we now have a raise SE node, we are all done. - null; + if Nkind (N) = N_Raise_Storage_Error then + return; + end if; - -- If call is to immediately containing subprogram, then check for - -- the case of a possible run-time detectable infinite recursion. + -- If call is to immediately containing subprogram, then check for + -- the case of a possible run-time detectable infinite recursion. else Scope_Loop : while Scop /= Standard_Standard loop @@ -4761,7 +4808,7 @@ package body Sem_Res is if Is_Inlined (Nam) and then Present (First_Rep_Item (Nam)) and then Nkind (First_Rep_Item (Nam)) = N_Pragma - and then Chars (First_Rep_Item (Nam)) = Name_Inline_Always + and then Pragma_Name (First_Rep_Item (Nam)) = Name_Inline_Always then null; @@ -7196,7 +7243,7 @@ package body Sem_Res is Orig : constant Node_Id := Original_Node (Parent (N)); begin if Nkind (Orig) = N_Pragma - and then Chars (Orig) = Name_Assert + and then Pragma_Name (Orig) = Name_Assert then -- Don't want to warn if original condition is explicit False diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 344122a0df0..c36805838e6 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1386,12 +1386,15 @@ package body Sem_Util is ADT : Elmt_Id; begin - ADT := Next_Elmt (First_Elmt (Access_Disp_Table (T))); + ADT := Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (T)))); while Present (ADT) and then Ekind (Node (ADT)) = E_Constant and then Related_Type (Node (ADT)) /= Iface loop - -- Skip the two secondary dispatch tables of Iface + -- Skip the secondary dispatch tables of Iface + + Next_Elmt (ADT); + Next_Elmt (ADT); Next_Elmt (ADT); Next_Elmt (ADT); end loop; @@ -3769,6 +3772,15 @@ package body Sem_Util is return Entity_Id (Get_Name_Table_Info (Id)); end Get_Name_Entity_Id; + ------------------- + -- Get_Pragma_Id -- + ------------------- + + function Get_Pragma_Id (N : Node_Id) return Pragma_Id is + begin + return Get_Pragma_Id (Pragma_Name (N)); + end Get_Pragma_Id; + --------------------------- -- Get_Referenced_Object -- --------------------------- @@ -3906,31 +3918,42 @@ package body Sem_Util is ----------------------------- function Has_Abstract_Interfaces - (Tagged_Type : Entity_Id; + (T : Entity_Id; Use_Full_View : Boolean := True) return Boolean is Typ : Entity_Id; begin - pragma Assert (Is_Record_Type (Tagged_Type) - and then Is_Tagged_Type (Tagged_Type)); + -- Handle concurrent types - -- Handle concurrent record types + if Is_Concurrent_Type (T) then + Typ := Corresponding_Record_Type (T); + else + Typ := T; + end if; - if Is_Concurrent_Record_Type (Tagged_Type) - and then Is_Non_Empty_List (Abstract_Interface_List (Tagged_Type)) + if not Present (Typ) + or else not Is_Tagged_Type (Typ) then - return True; + return False; end if; - Typ := Tagged_Type; + pragma Assert (Is_Record_Type (Typ)); -- Handle private types if Use_Full_View - and then Present (Full_View (Tagged_Type)) + and then Present (Full_View (Typ)) + then + Typ := Full_View (Typ); + end if; + + -- Handle concurrent record types + + if Is_Concurrent_Record_Type (Typ) + and then Is_Non_Empty_List (Abstract_Interface_List (Typ)) then - Typ := Full_View (Tagged_Type); + return True; end if; loop @@ -3953,7 +3976,7 @@ package body Sem_Util is -- Protect the frontend against wrong source with cyclic -- derivations - or else Etype (Typ) = Tagged_Type; + or else Etype (Typ) = T; -- Climb to the ancestor type handling private types @@ -8910,8 +8933,9 @@ package body Sem_Util is procedure Set_Convention (E : Entity_Id; Val : Snames.Convention_Id) is begin Basic_Set_Convention (E, Val); + if Is_Type (E) - and then Ekind (Base_Type (E)) in Access_Subprogram_Type_Kind + and then Is_Access_Subprogram_Type (Base_Type (E)) and then Has_Foreign_Convention (E) then Set_Can_Use_Internal_Rep (E, False); @@ -8932,6 +8956,93 @@ package body Sem_Util is Set_Name_Entity_Id (Chars (E), E); end Set_Current_Entity; + --------------------------- + -- Set_Debug_Info_Needed -- + --------------------------- + + procedure Set_Debug_Info_Needed (T : Entity_Id) is + + procedure Set_Debug_Info_Needed_If_Not_Set (E : Entity_Id); + pragma Inline (Set_Debug_Info_Needed_If_Not_Set); + -- Used to set debug info in a related node if not set already + + -------------------------------------- + -- Set_Debug_Info_Needed_If_Not_Set -- + -------------------------------------- + + procedure Set_Debug_Info_Needed_If_Not_Set (E : Entity_Id) is + begin + if Present (E) + and then not Needs_Debug_Info (E) + then + Set_Debug_Info_Needed (E); + end if; + end Set_Debug_Info_Needed_If_Not_Set; + + -- Start of processing for Set_Debug_Info_Needed + + begin + -- Nothing to do if argument is Empty or has Debug_Info_Off set, which + -- indicates that Debug_Info_Needed is never required for the entity. + + if No (T) + or else Debug_Info_Off (T) + then + return; + end if; + + -- Set flag in entity itself. Note that we will go through the following + -- circuitry even if the flag is already set on T. That's intentional, + -- it makes sure that the flag will be set in subsidiary entities. + + Set_Needs_Debug_Info (T); + + -- Set flag on subsidiary entities if not set already + + if Is_Object (T) then + Set_Debug_Info_Needed_If_Not_Set (Etype (T)); + + elsif Is_Type (T) then + Set_Debug_Info_Needed_If_Not_Set (Etype (T)); + + if Is_Record_Type (T) then + declare + Ent : Entity_Id := First_Entity (T); + begin + while Present (Ent) loop + Set_Debug_Info_Needed_If_Not_Set (Ent); + Next_Entity (Ent); + end loop; + end; + + elsif Is_Array_Type (T) then + Set_Debug_Info_Needed_If_Not_Set (Component_Type (T)); + + declare + Indx : Node_Id := First_Index (T); + begin + while Present (Indx) loop + Set_Debug_Info_Needed_If_Not_Set (Etype (Indx)); + Indx := Next_Index (Indx); + end loop; + end; + + if Is_Packed (T) then + Set_Debug_Info_Needed_If_Not_Set (Packed_Array_Type (T)); + end if; + + elsif Is_Access_Type (T) then + Set_Debug_Info_Needed_If_Not_Set (Directly_Designated_Type (T)); + + elsif Is_Private_Type (T) then + Set_Debug_Info_Needed_If_Not_Set (Full_View (T)); + + elsif Is_Protected_Type (T) then + Set_Debug_Info_Needed_If_Not_Set (Corresponding_Record_Type (T)); + end if; + end if; + end Set_Debug_Info_Needed; + --------------------------------- -- Set_Entity_With_Style_Check -- --------------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 58dbb536bb1..b48c8a95446 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -440,6 +440,15 @@ package Sem_Util is -- which is the innermost visible entity with the given name. See the -- body of Sem_Ch8 for further details on handling of entity visibility. + function Get_Pragma_Id (N : Node_Id) return Pragma_Id; + pragma Inline (Get_Pragma_Id); + -- Obtains the Pragma_Id from the Chars field of Pragma_Identifier (N) + + function Get_Referenced_Object (N : Node_Id) return Node_Id; + -- Given a node, return the renamed object if the node represents a renamed + -- object, otherwise return the node unchanged. The node may represent an + -- arbitrary expression. + function Get_Renamed_Entity (E : Entity_Id) return Entity_Id; -- Given an entity for an exception, package, subprogram or generic unit, -- returns the ultimately renamed entity if this is a renaming. If this is @@ -452,11 +461,6 @@ package Sem_Util is -- related subprogram or entry and returns it, or if no subprogram can -- be found, returns Empty. - function Get_Referenced_Object (N : Node_Id) return Node_Id; - -- Given a node, return the renamed object if the node represents - -- a renamed object, otherwise return the node unchanged. The node - -- may represent an arbitrary expression. - function Get_Subprogram_Body (E : Entity_Id) return Node_Id; -- Given the entity for a subprogram (E_Function or E_Procedure), -- return the corresponding N_Subprogram_Body node. If the corresponding @@ -476,17 +480,18 @@ package Sem_Util is -- T contains access values (happens for generic formals in some -- cases), then False is returned. + function Has_Abstract_Interfaces + (T : Entity_Id; + Use_Full_View : Boolean := True) return Boolean; + -- Where T is a concurrent type or a record type, returns true if T covers + -- any abstract interface types. In case of private types the argument + -- Use_Full_View controls if the check is done using its full view (if + -- available). + type Alignment_Result is (Known_Compatible, Unknown, Known_Incompatible); -- Result of Has_Compatible_Alignment test, description found below. Note -- that the values are arranged in increasing order of problematicness. - function Has_Abstract_Interfaces - (Tagged_Type : Entity_Id; - Use_Full_View : Boolean := True) return Boolean; - -- Returns true if Tagged_Type implements some abstract interface. In case - -- private types the argument Use_Full_View controls if the check is done - -- using its full view (if available). - function Has_Compatible_Alignment (Obj : Entity_Id; Expr : Node_Id) return Alignment_Result; @@ -1028,6 +1033,14 @@ package Sem_Util is -- Establish the entity E as the currently visible definition of its -- associated name (i.e. the Node_Id associated with its name) + procedure Set_Debug_Info_Needed (T : Entity_Id); + -- Sets the Debug_Info_Needed flag on entity T , and also on any entities + -- that are needed by T (for an object, the type of the object is needed, + -- and for a type, various subsidiary types are needed -- see body for + -- details). Never has any effect on T if the Debug_Info_Off flag is set. + -- This routine should always be used instead of Set_Needs_Debug_Info to + -- ensure that subsidiary entities are properly handled. + procedure Set_Entity_With_Style_Check (N : Node_Id; Val : Entity_Id); -- This procedure has the same calling sequence as Set_Entity, but -- if Style_Check is set, then it calls a style checking routine which diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 46a6954bc21..81d866f5645 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -23,7 +23,6 @@ -- -- ------------------------------------------------------------------------------ -with Alloc; with Atree; use Atree; with Debug; use Debug; with Einfo; use Einfo; @@ -44,7 +43,6 @@ with Sinput; use Sinput; with Snames; use Snames; with Stand; use Stand; with Stringt; use Stringt; -with Table; with Uintp; use Uintp; package body Sem_Warn is @@ -67,9 +65,9 @@ package body Sem_Warn is -- The reason that we defer output of these messages is that we want to -- detect the case where the relevant procedure is used as a generic actual -- in an instantation, since we suppress the warnings in this case. The - -- flag Used_As_Generic_Actual will be set in this case, but will not be - -- set till later. Similarly, we suppress the message if the address of - -- the procedure is taken, where the flag Address_Taken may be set later. + -- flag Used_As_Generic_Actual will be set in this case, but only at the + -- point of usage. Similarly, we suppress the message if the address of the + -- procedure is taken, where the flag Address_Taken may be set later. package In_Out_Warnings is new Table.Table ( Table_Component_Type => Entity_Id, @@ -79,6 +77,39 @@ package body Sem_Warn is Table_Increment => Alloc.In_Out_Warnings_Increment, Table_Name => "In_Out_Warnings"); + -------------------------------------------------------- + -- Handling of Warnings Off, Unmodified, Unreferenced -- + -------------------------------------------------------- + + -- The functions Has_Warnings_Off, Has_Unmodified, Has_Unreferenced must + -- generally be used instead of Warnings_Off, Has_Pragma_Unmodified and + -- Has_Pragma_Unreferenced, as noted in the specs in Einfo. + + -- In order to avoid losing warnings in -gnatw.w (warn on unnecessary + -- warnings off pragma) mode, i.e. to avoid false negatives, the code + -- must follow some important rules. + + -- Call these functions as late as possible, after completing all other + -- tests, just before the warnings is given. For example, don't write: + + -- if not Has_Warnings_Off (E) + -- and then some-other-predicate-on-E then .. + + -- Instead the following is preferred + + -- if somme-other-predicate-on-E + -- and then Has_Warnings_Off (E) + + -- This way if some-other-predicate is false, we avoid a false indication + -- that a Warnings (Off,E) pragma was useful in preventing a warning. + + -- The second rule is that if both Has_Unmodified and Has_Warnings_Off, or + -- Has_Unreferenced and Has_Warnings_Off are called, make sure that the + -- call to Has_Unmodified/Has_Unreferenced comes first, this way we record + -- that the Warnings (Off) could have been Unreferenced or Unmodified. In + -- fact Has_Unmodified/Has_Unreferenced includes a test for Warnings Off, + -- and so a subsequent test is not needed anyway (though it is harmless). + ----------------------- -- Local Subprograms -- ----------------------- @@ -145,6 +176,10 @@ package body Sem_Warn is -- accept statement, and the message is posted on Body_E. In all other -- cases, Body_E is ignored and must be Empty. + function Warnings_Off_Check_Spec (E : Entity_Id) return Boolean; + -- Returns True if Warnings_Off is set for the entity E or (in the case + -- where there is a Spec_Entity), Warnings_Off is set for the Spec_Entity. + -------------------------- -- Check_Code_Statement -- -------------------------- @@ -275,15 +310,15 @@ package body Sem_Warn is if not Is_Entity_Name (Name (N)) then return; - -- Forget it if warnings are suppressed on function entity + -- Forget it if function name is suspicious. A strange test + -- but warning generation is in the heuristics business! - elsif Warnings_Off (Entity (Name (N))) then + elsif Is_Suspicious_Function_Name (Entity (Name (N))) then return; - -- Forget it if function name is suspicious. A strange test - -- but warning generation is in the heuristics business! + -- Forget it if warnings are suppressed on function entity - elsif Is_Suspicious_Function_Name (Entity (Name (N))) then + elsif Has_Warnings_Off (Entity (Name (N))) then return; end if; @@ -592,6 +627,40 @@ package body Sem_Warn is -- from another unit. This is true for entities in packages that are at -- the library level. + function Warnings_Off_E1 return Boolean; + -- Return True if Warnings_Off is set for E1, or for its Etype (E1T), + -- or for the base type of E1T. + + ----------------- + -- Body_Formal -- + ----------------- + + function Body_Formal + (E : Entity_Id; + Accept_Statement : Node_Id) return Entity_Id + is + Body_Param : Node_Id; + Body_E : Entity_Id; + + begin + -- Loop to find matching parameter in accept statement + + Body_Param := First (Parameter_Specifications (Accept_Statement)); + while Present (Body_Param) loop + Body_E := Defining_Identifier (Body_Param); + + if Chars (Body_E) = Chars (E) then + return Body_E; + end if; + + Next (Body_Param); + end loop; + + -- Should never fall through, should always find a match + + raise Program_Error; + end Body_Formal; + ---------------------- -- Missing_Subunits -- ---------------------- @@ -634,36 +703,6 @@ package body Sem_Warn is end if; end Missing_Subunits; - ----------------- - -- Body_Formal -- - ----------------- - - function Body_Formal - (E : Entity_Id; - Accept_Statement : Node_Id) return Entity_Id - is - Body_Param : Node_Id; - Body_E : Entity_Id; - - begin - -- Loop to find matching parameter in accept statement - - Body_Param := First (Parameter_Specifications (Accept_Statement)); - while Present (Body_Param) loop - Body_E := Defining_Identifier (Body_Param); - - if Chars (Body_E) = Chars (E) then - return Body_E; - end if; - - Next (Body_Param); - end loop; - - -- Should never fall through, should always find a match - - raise Program_Error; - end Body_Formal; - ---------------------------- -- Output_Reference_Error -- ---------------------------- @@ -790,6 +829,17 @@ package body Sem_Warn is end loop; end Publicly_Referenceable; + --------------------- + -- Warnings_Off_E1 -- + --------------------- + + function Warnings_Off_E1 return Boolean is + begin + return Has_Warnings_Off (E1T) + or else Has_Warnings_Off (Base_Type (E1T)) + or else Warnings_Off_Check_Spec (E1); + end Warnings_Off_E1; + -- Start of processing for Check_References begin @@ -817,15 +867,11 @@ package body Sem_Warn is while Present (E1) loop E1T := Etype (E1); - -- We only look at source entities with warning flag on. We also - -- ignore objects whose type or base type has warnings suppressed. - -- We also don't issue warnings within instances, since the proper - -- place for such warnings is on the template when it is compiled. + -- We are only interested in source entities. We also don't issue + -- warnings within instances, since the proper place for such + -- warnings is on the template when it is compiled. if Comes_From_Source (E1) - and then not Warnings_Off (E1) - and then not Warnings_Off (E1T) - and then not Warnings_Off (Base_Type (E1T)) and then Instantiation_Location (Sloc (E1)) = No_Location then -- We are interested in variables and out/in-out parameters, but @@ -850,18 +896,9 @@ package body Sem_Warn is UR := Unset_Reference (E1); end if; - -- If the entity is an out parameter of the current subprogram - -- body, check the warning status of the parameter in the spec. - - if Is_Formal (E1) - and then Present (Spec_Entity (E1)) - and then Warnings_Off (Spec_Entity (E1)) - then - null; - -- Special processing for access types - elsif Present (UR) + if Present (UR) and then Is_Access_Type (E1T) then -- For access types, the only time we made a UR entry was @@ -872,7 +909,10 @@ package body Sem_Warn is -- assignment of a pointer involving discriminant check -- on the designated object). - Error_Msg_NE ("?& may be null!", UR, E1); + if not Warnings_Off_E1 then + Error_Msg_NE ("?& may be null!", UR, E1); + end if; + goto Continue; -- Case of variable that could be a constant. Note that we @@ -916,10 +956,12 @@ package body Sem_Warn is and then not Has_Pragma_Unreferenced_Check_Spec (E1) and then not Has_Pragma_Unmodified_Check_Spec (E1) then - Error_Msg_N - ("?& is not modified, " - & "could be declared constant!", - E1); + if not Warnings_Off_E1 then + Error_Msg_N + ("?& is not modified, " + & "could be declared constant!", + E1); + end if; end if; end if; end if; @@ -959,12 +1001,15 @@ package body Sem_Warn is or else not Is_Fully_Initialized_Type (E1T)) then -- Do not output complaint about never being assigned a - -- value if a pragma Unreferenced applies to the variable + -- value if a pragma Unmodified applies to the variable -- we are examining, or if it is a parameter, if there is - -- a pragma Unreferenced for the corresponding spec. + -- a pragma Unreferenced for the corresponding spec, of + -- if the type is marked as having unreferenced objects. + -- The last is a little peculiar, but better too few than + -- too many warnings in this situation. - if Has_Pragma_Unreferenced_Check_Spec (E1) - or else Has_Pragma_Unreferenced_Objects (E1T) + if Has_Pragma_Unreferenced_Objects (E1T) + or else Has_Pragma_Unmodified_Check_Spec (E1) then null; @@ -985,7 +1030,7 @@ package body Sem_Warn is -- other method to achieve the local effect of a -- modification. On the other hand if the spec and body -- are in the same unit, we are in the package body and - -- there we less excuse for a junk IN OUT parameter. + -- there we have less excuse for a junk IN OUT parameter. if Has_Private_Declaration (E1T) and then Present (Spec_Entity (E1)) @@ -996,8 +1041,8 @@ package body Sem_Warn is -- Suppress warning for any parameter of a dispatching -- operation, since it is quite reasonable to have an -- operation that is overridden, and for some subclasses - -- needs to be IN OUT and for others the parameter does - -- not happen to be assigned. + -- needs the formal to be IN OUT and for others happens + -- not to assign it. elsif Is_Dispatching_Operation (Scope (Goto_Spec_Entity (E1))) @@ -1030,25 +1075,38 @@ package body Sem_Warn is -- Other cases of formals elsif Is_Formal (E1) then - if Referenced_Check_Spec (E1) then - if not Has_Pragma_Unmodified_Check_Spec (E1) then + if not Is_Trivial_Subprogram (Scope (E1)) then + if Referenced_Check_Spec (E1) then + if not Has_Pragma_Unmodified_Check_Spec (E1) + and then not Warnings_Off_E1 + then + Output_Reference_Error + ("?formal parameter& is read but " + & "never assigned!"); + end if; + + elsif not Has_Pragma_Unreferenced_Check_Spec (E1) + and then not Warnings_Off_E1 + then Output_Reference_Error - ("?formal parameter& is read but " - & "never assigned!"); + ("?formal parameter& is not referenced!"); end if; - - else - Output_Reference_Error - ("?formal parameter& is not referenced!"); end if; -- Case of variable else if Referenced (E1) then - Output_Reference_Error - ("?variable& is read but never assigned!"); - else + if not Has_Unmodified (E1) + and then not Warnings_Off_E1 + then + Output_Reference_Error + ("?variable& is read but never assigned!"); + end if; + + elsif not Has_Unreferenced (E1) + and then not Warnings_Off_E1 + then Output_Reference_Error ("?variable& is never read and never assigned!"); end if; @@ -1058,6 +1116,7 @@ package body Sem_Warn is if Ekind (E1) = E_Variable and then Present (Hiding_Loop_Variable (E1)) + and then not Warnings_Off_E1 then Error_Msg_N ("?for loop implicitly declares loop variable!", @@ -1100,62 +1159,70 @@ package body Sem_Warn is -- are only for functions, and functions do not allow OUT -- parameters.) - if Nkind (UR) = N_Simple_Return_Statement - and then not Has_Pragma_Unmodified_Check_Spec (E1) - then - Error_Msg_NE - ("?OUT parameter& not set before return", UR, E1); + if not Is_Trivial_Subprogram (Scope (E1)) then + if Nkind (UR) = N_Simple_Return_Statement + and then not Has_Pragma_Unmodified_Check_Spec (E1) + then + if not Warnings_Off_E1 then + Error_Msg_NE + ("?OUT parameter& not set before return", UR, E1); + end if; - -- If the unset reference is prefix of a selected component - -- that comes from source, mention the component as well. If - -- the selected component comes from expansion, all we know - -- is that the entity is not fully initialized at the point - -- of the reference. Locate an unintialized component to get - -- a better error message. + -- If the unset reference is a selected component + -- prefix from source, mention the component as well. + -- If the selected component comes from expansion, all + -- we know is that the entity is not fully initialized + -- at the point of the reference. Locate a random + -- unintialized component to get a better message. - elsif Nkind (Parent (UR)) = N_Selected_Component then - Error_Msg_Node_2 := Selector_Name (Parent (UR)); + elsif Nkind (Parent (UR)) = N_Selected_Component then + Error_Msg_Node_2 := Selector_Name (Parent (UR)); - if not Comes_From_Source (Parent (UR)) then - declare - Comp : Entity_Id; + if not Comes_From_Source (Parent (UR)) then + declare + Comp : Entity_Id; - begin - Comp := First_Entity (E1T); - while Present (Comp) loop - if Ekind (Comp) = E_Component - and then Nkind (Parent (Comp)) = - N_Component_Declaration - and then No (Expression (Parent (Comp))) - then - Error_Msg_Node_2 := Comp; - exit; - end if; + begin + Comp := First_Entity (E1T); + while Present (Comp) loop + if Ekind (Comp) = E_Component + and then Nkind (Parent (Comp)) = + N_Component_Declaration + and then No (Expression (Parent (Comp))) + then + Error_Msg_Node_2 := Comp; + exit; + end if; + + Next_Entity (Comp); + end loop; + end; + end if; - Next_Entity (Comp); - end loop; - end; - end if; + -- Issue proper warning. This is a case of referencing + -- a variable before it has been explicitly assigned. + -- For access types, UR was only set for dereferences, + -- so the issue is that the value may be null. + + if not Is_Trivial_Subprogram (Scope (E1)) then + if not Warnings_Off_E1 then + if Is_Access_Type (Etype (Parent (UR))) then + Error_Msg_N ("?`&.&` may be null!", UR); + else + Error_Msg_N + ("?`&.&` may be referenced before " + & "it has a value!", UR); + end if; + end if; + end if; - -- Issue proper warning. This is a case of referencing - -- a variable before it has been explicitly assigned. - -- For access types, UR was only set for dereferences, - -- so the issue is that the value may be null. + -- All other cases of unset reference active - if Is_Access_Type (Etype (Parent (UR))) then - Error_Msg_N ("?`&.&` may be null!", UR); - else + elsif not Warnings_Off_E1 then Error_Msg_N - ("?`&.&` may be referenced before it has a value!", + ("?& may be referenced before it has a value!", UR); end if; - - -- All other cases of unset reference active - - else - Error_Msg_N - ("?& may be referenced before it has a value!", - UR); end if; goto Continue; @@ -1163,12 +1230,17 @@ package body Sem_Warn is end if; -- Then check for unreferenced entities. Note that we are only - -- interested in entities which do not have the Referenced flag - -- set. The Referenced_As_LHS flag is interesting only if the - -- Referenced flag is not set. + -- interested in entities whose Referenced flag is not set. if not Referenced_Check_Spec (E1) + -- If Referenced_As_LHS is set, then that's still interesting + -- (potential "assigned but never read" case), but not if we + -- have pragma Unreferenced, which cancels this error. + + and then (not Referenced_As_LHS_Check_Spec (E1) + or else not Has_Unreferenced (E1)) + -- Check that warnings on unreferenced entities are enabled and then @@ -1324,10 +1396,12 @@ package body Sem_Warn is -- The unreferenced entity is E1, but post the warning -- on the body entity for this accept statement. - Warn_On_Unreferenced_Entity - (E1, Body_Formal (E1, Accept_Statement => Anod)); + if not Warnings_Off_E1 then + Warn_On_Unreferenced_Entity + (E1, Body_Formal (E1, Accept_Statement => Anod)); + end if; - else + elsif not Warnings_Off_E1 then Unreferenced_Entities.Append (E1); end if; end if; @@ -1343,11 +1417,13 @@ package body Sem_Warn is and then Instantiation_Depth (Sloc (E1)) = 0 and then Warn_On_Redundant_Constructs then - Unreferenced_Entities.Append (E1); + if not Warnings_Off_E1 then + Unreferenced_Entities.Append (E1); -- Force warning on entity - Set_Referenced (E1, False); + Set_Referenced (E1, False); + end if; end if; end if; @@ -1478,7 +1554,8 @@ package body Sem_Warn is or else Earlier_In_Extended_Unit (Sloc (N), Sloc (Unset_Reference (E)))) - and then not Warnings_Off (E) + and then not Has_Pragma_Unmodified_Check_Spec (E) + and then not Warnings_Off_Check_Spec (E) then -- We may have an unset reference. The first test is whether -- this is an access to a discriminant of a record or a @@ -1967,7 +2044,7 @@ package body Sem_Warn is -- is explicitly marked by a pragma Unreferenced). if not Referenced (Lunit) - and then not Has_Pragma_Unreferenced (Lunit) + and then not Has_Unreferenced (Lunit) then -- Suppress warnings in internal units if not in -gnatg mode -- (these would be junk warnings for an application program, @@ -2060,8 +2137,8 @@ package body Sem_Warn is -- Else give the warning else - if not Has_Pragma_Unreferenced - (Entity (Name (Item))) + if not + Has_Unreferenced (Entity (Name (Item))) then Error_Msg_N ("?no entities of & are referenced!", @@ -2076,8 +2153,8 @@ package body Sem_Warn is Pack := Find_Package_Renaming (Munite, Lunit); if Present (Pack) - and then not Warnings_Off (Lunit) - and then not Has_Pragma_Unreferenced (Pack) + and then not Has_Warnings_Off (Lunit) + and then not Has_Unreferenced (Pack) then Error_Msg_NE ("?no entities of & are referenced!", @@ -2276,11 +2353,16 @@ package body Sem_Warn is is begin if Is_Formal (E) and then Present (Spec_Entity (E)) then - return Has_Pragma_Unmodified (E) - or else - Has_Pragma_Unmodified (Spec_Entity (E)); + + -- Note: use of OR instead of OR ELSE here is deliberate, we want + -- to mess with Unmodified flags on both body and spec entities. + + return Has_Unmodified (E) + or + Has_Unmodified (Spec_Entity (E)); + else - return Has_Pragma_Unmodified (E); + return Has_Unmodified (E); end if; end Has_Pragma_Unmodified_Check_Spec; @@ -2293,14 +2375,30 @@ package body Sem_Warn is is begin if Is_Formal (E) and then Present (Spec_Entity (E)) then - return Has_Pragma_Unreferenced (E) - or else - Has_Pragma_Unreferenced (Spec_Entity (E)); + + -- Note: use of OR here instead of OR ELSE is deliberate, we want + -- to mess with flags on both entities. + + return Has_Unreferenced (E) + or + Has_Unreferenced (Spec_Entity (E)); + else - return Has_Pragma_Unreferenced (E); + return Has_Unreferenced (E); end if; end Has_Pragma_Unreferenced_Check_Spec; + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize is + begin + Warnings_Off_Pragmas.Init; + Unreferenced_Entities.Init; + In_Out_Warnings.Init; + end Initialize; + ------------------------------------ -- Never_Set_In_Source_Check_Spec -- ------------------------------------ @@ -2341,7 +2439,7 @@ package body Sem_Warn is begin if Nkind (R) in N_Has_Entity and then Present (Entity (R)) - and then Warnings_Off (Entity (R)) + and then Has_Warnings_Off (Entity (R)) then return Abandon; else @@ -2383,16 +2481,33 @@ package body Sem_Warn is ----------------------- function No_Warn_On_In_Out (E : Entity_Id) return Boolean is - S : constant Entity_Id := Scope (E); + S : constant Entity_Id := Scope (E); + SE : constant Entity_Id := Spec_Entity (E); + begin - if Warnings_Off (S) then + -- Do not warn if address is taken, since funny business may be going + -- on in treating the parameter indirectly as IN OUT. + + if Address_Taken (S) + or else (Present (SE) and then Address_Taken (Scope (SE))) + then return True; - elsif Address_Taken (S) then + + -- Do not warn if used as a generic actual, since the generic may be + -- what is forcing the use of an "unnecessary" IN OUT. + + elsif Used_As_Generic_Actual (S) + or else (Present (SE) and then Used_As_Generic_Actual (Scope (SE))) + then return True; - elsif Used_As_Generic_Actual (S) then + + -- Else test warnings off + + elsif Warnings_Off_Check_Spec (S) then return True; - elsif Present (Spec_Entity (E)) then - return No_Warn_On_In_Out (Spec_Entity (E)); + + -- All tests for suppressing warning failed + else return False; end if; @@ -2411,8 +2526,8 @@ package body Sem_Warn is -- Suppress warning in specific cases (see details in comments for -- No_Warn_On_In_Out), or if there is a pragma Unmodified. - if No_Warn_On_In_Out (E1) - or else Has_Pragma_Unmodified_Check_Spec (E1) + if Has_Pragma_Unmodified_Check_Spec (E1) + or else No_Warn_On_In_Out (E1) then null; @@ -2421,18 +2536,23 @@ package body Sem_Warn is else -- If -gnatwc is set then output message that we could be IN - if Warn_On_Constant then - Error_Msg_N ("?formal parameter & is not modified!", E1); - Error_Msg_N ("\?mode could be IN instead of `IN OUT`!", E1); + if not Is_Trivial_Subprogram (Scope (E1)) then + if Warn_On_Constant then + Error_Msg_N + ("?formal parameter & is not modified!", E1); + Error_Msg_N + ("\?mode could be IN instead of `IN OUT`!", E1); - -- We do not generate warnings for IN OUT parameters unless we - -- have at least -gnatwu. This is deliberately inconsistent - -- with the treatment of variables, but otherwise we get too - -- many unexpected warnings in default mode. + -- We do not generate warnings for IN OUT parameters + -- unless we have at least -gnatwu. This is deliberately + -- inconsistent with the treatment of variables, but + -- otherwise we get too many unexpected warnings in + -- default mode. - elsif Check_Unreferenced then - Error_Msg_N ("?formal parameter& is read but " - & "never assigned!", E1); + elsif Check_Unreferenced then + Error_Msg_N ("?formal parameter& is read but " + & "never assigned!", E1); + end if; end if; -- Kill any other warnings on this entity, since this is the @@ -2600,6 +2720,62 @@ package body Sem_Warn is end loop; end Output_Unreferenced_Messages; + ----------------------------------------- + -- Output_Unused_Warnings_Off_Warnings -- + ----------------------------------------- + + procedure Output_Unused_Warnings_Off_Warnings is + begin + for J in Warnings_Off_Pragmas.First .. Warnings_Off_Pragmas.Last loop + declare + Wentry : Warnings_Off_Entry renames Warnings_Off_Pragmas.Table (J); + N : Node_Id renames Wentry.N; + E : Node_Id renames Wentry.E; + + begin + -- Turn off Warnings_Off, or we won't get the warning! + + Set_Warnings_Off (E, False); + + -- Nothing to do if pragma was used to suppress a general warning + + if Warnings_Off_Used (E) then + null; + + -- If pragma was used both in unmodified and unreferenced contexts + -- then that's as good as the general case, no warning. + + elsif Warnings_Off_Used_Unmodified (E) + and + Warnings_Off_Used_Unreferenced (E) + then + null; + + -- Used only in context where Unmodified would have worked + + elsif Warnings_Off_Used_Unmodified (E) then + Error_Msg_NE + ("?could use Unmodified instead of " + & "Warnings Off for &", Pragma_Identifier (N), E); + + -- Used only in context where Unreferenced would have worked + + elsif Warnings_Off_Used_Unreferenced (E) then + Error_Msg_NE + ("?could use Unreferenced instead of " + & "Warnings Off for &", Pragma_Identifier (N), E); + + -- Not used at all + + else + Error_Msg_NE + ("?pragma Warnings Off for & unused, " + & "could be omitted", N, E); + end if; + end; + end loop; + end Output_Unused_Warnings_Off_Warnings; + --------------------------- -- Referenced_Check_Spec -- --------------------------- @@ -2674,6 +2850,12 @@ package body Sem_Warn is when 'R' => Warn_On_Object_Renames_Function := False; + when 'w' => + Warn_On_Warnings_Off := True; + + when 'W' => + Warn_On_Warnings_Off := False; + when 'x' => Warn_On_Non_Local_Exception := True; @@ -2746,6 +2928,7 @@ package body Sem_Warn is Warn_On_Unchecked_Conversion := False; Warn_On_Unrecognized_Pragma := False; Warn_On_Unrepped_Components := False; + Warn_On_Warnings_Off := False; when 'b' => Warn_On_Bad_Fixed_Value := True; @@ -2997,7 +3180,7 @@ package body Sem_Warn is -- node, since assert pragmas get rewritten at analysis time. elsif Nkind (Original_Node (P)) = N_Pragma - and then Chars (Original_Node (P)) = Name_Assert + and then Pragma_Name (Original_Node (P)) = Name_Assert then return; end if; @@ -3100,12 +3283,12 @@ package body Sem_Warn is if Is_Array_Type (Typ) and then not Is_Constrained (Typ) and then Number_Dimensions (Typ) = 1 - and then not Warnings_Off (Typ) and then (Root_Type (Typ) = Standard_String or else Root_Type (Typ) = Standard_Wide_String or else Root_Type (Typ) = Standard_Wide_Wide_String) + and then not Has_Warnings_Off (Typ) then LB := Type_Low_Bound (Etype (First_Index (Typ))); @@ -3412,7 +3595,10 @@ package body Sem_Warn is E : Entity_Id := Spec_E; begin - if not Referenced_Check_Spec (E) and then not Warnings_Off (E) then + if not Referenced_Check_Spec (E) + and then not Has_Pragma_Unreferenced_Check_Spec (E) + and then not Warnings_Off_Check_Spec (E) + then case Ekind (E) is when E_Variable => @@ -3494,8 +3680,12 @@ package body Sem_Warn is if Present (Body_E) then E := Body_E; end if; - Error_Msg_NE - ("?formal parameter & is not referenced!", E, Spec_E); + + if not Is_Trivial_Subprogram (Scope (E)) then + Error_Msg_NE + ("?formal parameter & is not referenced!", + E, Spec_E); + end if; end if; end if; @@ -3585,20 +3775,19 @@ package body Sem_Warn is if Is_Assignable (Ent) and then not Is_Return_Object (Ent) and then Present (Last_Assignment (Ent)) - and then not Warnings_Off (Ent) - and then not Has_Pragma_Unreferenced_Check_Spec (Ent) and then not Is_Imported (Ent) and then not Is_Exported (Ent) and then Safe_To_Capture_Value (N, Ent) + and then not Has_Pragma_Unreferenced_Check_Spec (Ent) then -- Before we issue the message, check covering exception handlers. - -- Search up tree for enclosing statement sequences and handlers + -- Search up tree for enclosing statement sequences and handlers. P := Parent (Last_Assignment (Ent)); while Present (P) loop - -- Something is really wrong if we don't find a handled - -- statement sequence, so just suppress the warning. + -- Something is really wrong if we don't find a handled statement + -- sequence, so just suppress the warning. if No (P) then Set_Last_Assignment (Ent, Empty); @@ -3712,4 +3901,24 @@ package body Sem_Warn is end if; end Warn_On_Useless_Assignments; + ----------------------------- + -- Warnings_Off_Check_Spec -- + ----------------------------- + + function Warnings_Off_Check_Spec (E : Entity_Id) return Boolean is + begin + if Is_Formal (E) and then Present (Spec_Entity (E)) then + + -- Note: use of OR here instead of OR ELSE is deliberate, we want + -- to mess with flags on both entities. + + return Has_Warnings_Off (E) + or + Has_Warnings_Off (Spec_Entity (E)); + + else + return Has_Warnings_Off (E); + end if; + end Warnings_Off_Check_Spec; + end Sem_Warn; diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads index ae93f5ada6a..d78bba96eca 100644 --- a/gcc/ada/sem_warn.ads +++ b/gcc/ada/sem_warn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1999-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -27,14 +27,44 @@ -- about uses of uninitialized variables and unused with's. It also has -- some unrelated routines related to the generation of warnings. +with Alloc; use Alloc; +with Table; with Types; use Types; package Sem_Warn is + ------------------------ + -- Warnings Off Table -- + ------------------------ + + type Warnings_Off_Entry is record + N : Node_Id; + -- A pragma Warnings (Off, ent) node + + E : Entity_Id; + -- The entity involved + end record; + + -- An entry is made in the following table for any valid Pragma Warnings + -- (Off, entity) encountered while Opt.Warn_On_Warnings_Off is True. It + -- is used to generate warnings on any of these pragmas that turn out not + -- to be needed, or that could be replaced by Unmodified/Unreferenced. + + package Warnings_Off_Pragmas is new Table.Table ( + Table_Component_Type => Warnings_Off_Entry, + Table_Index_Type => Int, + Table_Low_Bound => 0, + Table_Initial => Alloc.Warnings_Off_Pragmas_Initial, + Table_Increment => Alloc.Warnings_Off_Pragmas_Increment, + Table_Name => "Name_Warnings_Off_Pragmas"); + -------------------- -- Initialization -- -------------------- + procedure Initialize; + -- Initialize this package for new compilation + function Set_Warning_Switch (C : Character) return Boolean; -- This function sets the warning switch or switches corresponding to the -- given character. It is used to process a -gnatw switch on the command @@ -121,6 +151,12 @@ package Sem_Warn is -- the compilation process (see Check_Unset_Reference for further -- details). This procedure outputs waiting warnings, if any. + procedure Output_Unused_Warnings_Off_Warnings; + -- Warnings about pragma Warnings (Off, ent) statements that are unused, + -- or could be replaced by Unmodified/Unreferenced pragmas, are collected + -- till the end of the compilation process. This procedure outputs waiting + -- warnings if any. + ---------------------------- -- Other Warning Routines -- ---------------------------- diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index 2baa94b7d3a..528d7f43a40 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1264,6 +1264,14 @@ package body Sinfo is return Flag5 (N); end Forwards_OK; + function From_At_End + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Raise_Statement); + return Flag4 (N); + end From_At_End; + function From_At_Mod (N : Node_Id) return Boolean is begin @@ -3995,6 +4003,14 @@ package body Sinfo is Set_Flag5 (N, Val); end Set_Forwards_OK; + procedure Set_From_At_End + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Raise_Statement); + Set_Flag4 (N, Val); + end Set_From_At_End; + procedure Set_From_At_Mod (N : Node_Id; Val : Boolean := True) is begin @@ -5574,9 +5590,9 @@ package body Sinfo is UI_From_Int (Int (S) - Int (Sloc (N)))); end Set_End_Location; - -------------------------------- - -- Node_Kind Membership Tests -- - -------------------------------- + -------------- + -- Nkind_In -- + -------------- function Nkind_In (T : Node_Kind; @@ -5690,4 +5706,13 @@ package body Sinfo is T = V8; end Nkind_In; + ----------------- + -- Pragma_Name -- + ----------------- + + function Pragma_Name (N : Node_Id) return Name_Id is + begin + return Chars (Pragma_Identifier (N)); + end Pragma_Name; + end Sinfo; diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index d1f20176768..5c131465a92 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1032,6 +1032,13 @@ package Sinfo is -- could not determine that either direction is definitely safe, and a -- runtime check is required. + -- From_At_End (Flag4-Sem) + -- This flag is set on an N_Raise_Statement node if it corresponds to + -- the reraise statement generated as the last statement of an AT END + -- handler when SJLJ exception handling is active. It is used to stop + -- a bogus violation of restriction (No_Exception_Propagation), bogus + -- because if the restriction is set, the reraise is not generated. + -- From_At_Mod (Flag4-Sem) -- This flag is set on the attribute definition clause node that is -- generated by a transformation of an at mod phrase in a record @@ -1876,7 +1883,6 @@ package Sinfo is -- N_Pragma -- Sloc points to pragma identifier - -- Chars (Name1) identifier name from pragma identifier -- Pragma_Argument_Associations (List2) (set to No_List if none) -- Debug_Statement (Node3) (set to Empty if not Debug, Assert) -- Pragma_Identifier (Node4) @@ -1887,12 +1893,8 @@ package Sinfo is -- Psect_Object is always converted to Common_Object, but there are -- undoubtedly many other similar notes required ??? - -- Note: we don't really need the Chars field, since it can trivially - -- be obtained as Chars (Pragma_Identifier (Node)). However, it is - -- convenient to have this directly available, and historically the - -- Chars field has been around for ever, whereas the Pragma_Identifier - -- field was added much later (when we found the need to be able to get - -- the Sloc of the pragma identifier). + -- Note: a utility function Pragma_Name may be applied to pragma nodes + -- to conveniently obtain the Chars field of the Pragma_Identifier. -------------------------------------- -- 2.8 Pragma Argument Association -- @@ -5660,6 +5662,7 @@ package Sinfo is -- Sloc points to RAISE -- Name (Node2) (set to Empty if no exception name present) -- Expression (Node3) (set to Empty if no expression present) + -- From_At_End (Flag4-Sem) ------------------------------- -- 12.1 Generic Declaration -- @@ -6886,7 +6889,6 @@ package Sinfo is -- N_Has_Chars N_Empty, - N_Pragma, N_Pragma_Argument_Association, -- N_Has_Etype @@ -6983,10 +6985,8 @@ package Sinfo is N_Conditional_Expression, N_Explicit_Dereference, N_Function_Call, - N_Indexed_Component, N_Integer_Literal, - N_Null, N_Or_Else, N_Procedure_Call_Statement, @@ -7215,6 +7215,7 @@ package Sinfo is N_Package_Specification, N_Parameter_Association, N_Parameter_Specification, + N_Pragma, N_Protected_Definition, N_Range_Constraint, N_Real_Range_Specification, @@ -7796,6 +7797,9 @@ package Sinfo is function Forwards_OK (N : Node_Id) return Boolean; -- Flag5 + function From_At_End + (N : Node_Id) return Boolean; -- Flag4 + function From_At_Mod (N : Node_Id) return Boolean; -- Flag4 @@ -8666,6 +8670,9 @@ package Sinfo is procedure Set_From_At_Mod (N : Node_Id; Val : Boolean := True); -- Flag4 + procedure Set_From_At_End + (N : Node_Id; Val : Boolean := True); -- Flag4 + procedure Set_From_Default (N : Node_Id; Val : Boolean := True); -- Flag6 @@ -9238,6 +9245,14 @@ package Sinfo is pragma Inline (Nkind_In); -- Inline all above functions + ----------------------- + -- Utility Functions -- + ----------------------- + + function Pragma_Name (N : Node_Id) return Name_Id; + pragma Inline (Pragma_Name); + -- Convenient function to obtain Chars field of Pragma_Identifier + ----------------------------- -- Syntactic Parent Tables -- ----------------------------- @@ -10908,6 +10923,7 @@ package Sinfo is pragma Inline (Float_Truncate); pragma Inline (Formal_Type_Definition); pragma Inline (Forwards_OK); + pragma Inline (From_At_End); pragma Inline (From_At_Mod); pragma Inline (From_Default); pragma Inline (Generic_Associations); @@ -11194,6 +11210,7 @@ package Sinfo is pragma Inline (Set_Float_Truncate); pragma Inline (Set_Formal_Type_Definition); pragma Inline (Set_Forwards_OK); + pragma Inline (Set_From_At_End); pragma Inline (Set_From_At_Mod); pragma Inline (Set_From_Default); pragma Inline (Set_Generic_Associations); diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb index 6b3e9eea763..95fc9b1e4f2 100644 --- a/gcc/ada/snames.adb +++ b/gcc/ada/snames.adb @@ -206,6 +206,7 @@ package body Snames is "no_run_time#" & "no_strict_aliasing#" & "normalize_scalars#" & + "optimize_alignment#" & "polling#" & "persistent_bss#" & "priority_specific_dispatching#" & @@ -495,6 +496,7 @@ package body Snames is "modulus#" & "null_parameter#" & "object_size#" & + "old#" & "partition_id#" & "passed_by_reference#" & "pool_address#" & @@ -778,6 +780,8 @@ package body Snames is "stack#" & "switches#" & "symbolic_link_supported#" & + "sync#" & + "synchronize#" & "toolchain_description#" & "toolchain_version#" & "runtime_library_dir#" & diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads index 2b4d47b101c..6a6d0ceb316 100644 --- a/gcc/ada/snames.ads +++ b/gcc/ada/snames.ads @@ -371,37 +371,38 @@ package Snames is Name_No_Run_Time : constant Name_Id := N + 145; -- GNAT Name_No_Strict_Aliasing : constant Name_Id := N + 146; -- GNAT Name_Normalize_Scalars : constant Name_Id := N + 147; - Name_Polling : constant Name_Id := N + 148; -- GNAT - Name_Persistent_BSS : constant Name_Id := N + 149; -- GNAT - Name_Priority_Specific_Dispatching : constant Name_Id := N + 150; -- Ada 05 - Name_Profile : constant Name_Id := N + 151; -- Ada 05 - Name_Profile_Warnings : constant Name_Id := N + 152; -- GNAT - Name_Propagate_Exceptions : constant Name_Id := N + 153; -- GNAT - Name_Queuing_Policy : constant Name_Id := N + 154; - Name_Ravenscar : constant Name_Id := N + 155; -- GNAT - Name_Restricted_Run_Time : constant Name_Id := N + 156; -- GNAT - Name_Restrictions : constant Name_Id := N + 157; - Name_Restriction_Warnings : constant Name_Id := N + 158; -- GNAT - Name_Reviewable : constant Name_Id := N + 159; - Name_Source_File_Name : constant Name_Id := N + 160; -- GNAT - Name_Source_File_Name_Project : constant Name_Id := N + 161; -- GNAT - Name_Style_Checks : constant Name_Id := N + 162; -- GNAT - Name_Suppress : constant Name_Id := N + 163; - Name_Suppress_Exception_Locations : constant Name_Id := N + 164; -- GNAT - Name_Task_Dispatching_Policy : constant Name_Id := N + 165; - Name_Universal_Data : constant Name_Id := N + 166; -- AAMP - Name_Unsuppress : constant Name_Id := N + 167; -- GNAT - Name_Use_VADS_Size : constant Name_Id := N + 168; -- GNAT - Name_Validity_Checks : constant Name_Id := N + 169; -- GNAT - Name_Warnings : constant Name_Id := N + 170; -- GNAT - Name_Wide_Character_Encoding : constant Name_Id := N + 171; -- GNAT - Last_Configuration_Pragma_Name : constant Name_Id := N + 171; + Name_Optimize_Alignment : constant Name_Id := N + 148; -- GNAT + Name_Polling : constant Name_Id := N + 149; -- GNAT + Name_Persistent_BSS : constant Name_Id := N + 150; -- GNAT + Name_Priority_Specific_Dispatching : constant Name_Id := N + 151; -- Ada 05 + Name_Profile : constant Name_Id := N + 152; -- Ada 05 + Name_Profile_Warnings : constant Name_Id := N + 153; -- GNAT + Name_Propagate_Exceptions : constant Name_Id := N + 154; -- GNAT + Name_Queuing_Policy : constant Name_Id := N + 155; + Name_Ravenscar : constant Name_Id := N + 156; -- GNAT + Name_Restricted_Run_Time : constant Name_Id := N + 157; -- GNAT + Name_Restrictions : constant Name_Id := N + 158; + Name_Restriction_Warnings : constant Name_Id := N + 159; -- GNAT + Name_Reviewable : constant Name_Id := N + 160; + Name_Source_File_Name : constant Name_Id := N + 161; -- GNAT + Name_Source_File_Name_Project : constant Name_Id := N + 162; -- GNAT + Name_Style_Checks : constant Name_Id := N + 163; -- GNAT + Name_Suppress : constant Name_Id := N + 164; + Name_Suppress_Exception_Locations : constant Name_Id := N + 165; -- GNAT + Name_Task_Dispatching_Policy : constant Name_Id := N + 166; + Name_Universal_Data : constant Name_Id := N + 167; -- AAMP + Name_Unsuppress : constant Name_Id := N + 168; -- GNAT + Name_Use_VADS_Size : constant Name_Id := N + 169; -- GNAT + Name_Validity_Checks : constant Name_Id := N + 170; -- GNAT + Name_Warnings : constant Name_Id := N + 171; -- GNAT + Name_Wide_Character_Encoding : constant Name_Id := N + 172; -- GNAT + Last_Configuration_Pragma_Name : constant Name_Id := N + 172; -- Remaining pragma names - Name_Abort_Defer : constant Name_Id := N + 172; -- GNAT - Name_All_Calls_Remote : constant Name_Id := N + 173; - Name_Annotate : constant Name_Id := N + 174; -- GNAT + Name_Abort_Defer : constant Name_Id := N + 173; -- GNAT + Name_All_Calls_Remote : constant Name_Id := N + 174; + Name_Annotate : constant Name_Id := N + 175; -- GNAT -- Note: AST_Entry is not in this list because its name matches -- VMS -- the name of the corresponding attribute. However, it is @@ -409,74 +410,74 @@ package Snames is -- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize -- and process Name_AST_Entry. - Name_Assert : constant Name_Id := N + 175; -- Ada 05 - Name_Asynchronous : constant Name_Id := N + 176; - Name_Atomic : constant Name_Id := N + 177; - Name_Atomic_Components : constant Name_Id := N + 178; - Name_Attach_Handler : constant Name_Id := N + 179; - Name_CIL_Constructor : constant Name_Id := N + 180; -- GNAT - Name_Comment : constant Name_Id := N + 181; -- GNAT - Name_Common_Object : constant Name_Id := N + 182; -- GNAT - Name_Complete_Representation : constant Name_Id := N + 183; -- GNAT - Name_Complex_Representation : constant Name_Id := N + 184; -- GNAT - Name_Controlled : constant Name_Id := N + 185; - Name_Convention : constant Name_Id := N + 186; - Name_CPP_Class : constant Name_Id := N + 187; -- GNAT - Name_CPP_Constructor : constant Name_Id := N + 188; -- GNAT - Name_CPP_Virtual : constant Name_Id := N + 189; -- GNAT - Name_CPP_Vtable : constant Name_Id := N + 190; -- GNAT - Name_Debug : constant Name_Id := N + 191; -- GNAT - Name_Elaborate : constant Name_Id := N + 192; -- Ada 83 - Name_Elaborate_All : constant Name_Id := N + 193; - Name_Elaborate_Body : constant Name_Id := N + 194; - Name_Export : constant Name_Id := N + 195; - Name_Export_Exception : constant Name_Id := N + 196; -- VMS - Name_Export_Function : constant Name_Id := N + 197; -- GNAT - Name_Export_Object : constant Name_Id := N + 198; -- GNAT - Name_Export_Procedure : constant Name_Id := N + 199; -- GNAT - Name_Export_Value : constant Name_Id := N + 200; -- GNAT - Name_Export_Valued_Procedure : constant Name_Id := N + 201; -- GNAT - Name_External : constant Name_Id := N + 202; -- GNAT - Name_Finalize_Storage_Only : constant Name_Id := N + 203; -- GNAT - Name_Ident : constant Name_Id := N + 204; -- VMS - Name_Implemented_By_Entry : constant Name_Id := N + 205; -- Ada 05 - Name_Import : constant Name_Id := N + 206; - Name_Import_Exception : constant Name_Id := N + 207; -- VMS - Name_Import_Function : constant Name_Id := N + 208; -- GNAT - Name_Import_Object : constant Name_Id := N + 209; -- GNAT - Name_Import_Procedure : constant Name_Id := N + 210; -- GNAT - Name_Import_Valued_Procedure : constant Name_Id := N + 211; -- GNAT - Name_Inline : constant Name_Id := N + 212; - Name_Inline_Always : constant Name_Id := N + 213; -- GNAT - Name_Inline_Generic : constant Name_Id := N + 214; -- GNAT - Name_Inspection_Point : constant Name_Id := N + 215; - Name_Interface_Name : constant Name_Id := N + 216; -- GNAT - Name_Interrupt_Handler : constant Name_Id := N + 217; - Name_Interrupt_Priority : constant Name_Id := N + 218; - Name_Java_Constructor : constant Name_Id := N + 219; -- GNAT - Name_Java_Interface : constant Name_Id := N + 220; -- GNAT - Name_Keep_Names : constant Name_Id := N + 221; -- GNAT - Name_Link_With : constant Name_Id := N + 222; -- GNAT - Name_Linker_Alias : constant Name_Id := N + 223; -- GNAT - Name_Linker_Constructor : constant Name_Id := N + 224; -- GNAT - Name_Linker_Destructor : constant Name_Id := N + 225; -- GNAT - Name_Linker_Options : constant Name_Id := N + 226; - Name_Linker_Section : constant Name_Id := N + 227; -- GNAT - Name_List : constant Name_Id := N + 228; - Name_Machine_Attribute : constant Name_Id := N + 229; -- GNAT - Name_Main : constant Name_Id := N + 230; -- GNAT - Name_Main_Storage : constant Name_Id := N + 231; -- GNAT - Name_Memory_Size : constant Name_Id := N + 232; -- Ada 83 - Name_No_Body : constant Name_Id := N + 233; -- GNAT - Name_No_Return : constant Name_Id := N + 234; -- GNAT - Name_Obsolescent : constant Name_Id := N + 235; -- GNAT - Name_Optimize : constant Name_Id := N + 236; - Name_Pack : constant Name_Id := N + 237; - Name_Page : constant Name_Id := N + 238; - Name_Passive : constant Name_Id := N + 239; -- GNAT - Name_Preelaborable_Initialization : constant Name_Id := N + 240; -- Ada 05 - Name_Preelaborate : constant Name_Id := N + 241; - Name_Preelaborate_05 : constant Name_Id := N + 242; -- GNAT + Name_Assert : constant Name_Id := N + 176; -- Ada 05 + Name_Asynchronous : constant Name_Id := N + 177; + Name_Atomic : constant Name_Id := N + 178; + Name_Atomic_Components : constant Name_Id := N + 179; + Name_Attach_Handler : constant Name_Id := N + 180; + Name_CIL_Constructor : constant Name_Id := N + 181; -- GNAT + Name_Comment : constant Name_Id := N + 182; -- GNAT + Name_Common_Object : constant Name_Id := N + 183; -- GNAT + Name_Complete_Representation : constant Name_Id := N + 184; -- GNAT + Name_Complex_Representation : constant Name_Id := N + 185; -- GNAT + Name_Controlled : constant Name_Id := N + 186; + Name_Convention : constant Name_Id := N + 187; + Name_CPP_Class : constant Name_Id := N + 188; -- GNAT + Name_CPP_Constructor : constant Name_Id := N + 189; -- GNAT + Name_CPP_Virtual : constant Name_Id := N + 190; -- GNAT + Name_CPP_Vtable : constant Name_Id := N + 191; -- GNAT + Name_Debug : constant Name_Id := N + 192; -- GNAT + Name_Elaborate : constant Name_Id := N + 193; -- Ada 83 + Name_Elaborate_All : constant Name_Id := N + 194; + Name_Elaborate_Body : constant Name_Id := N + 195; + Name_Export : constant Name_Id := N + 196; + Name_Export_Exception : constant Name_Id := N + 197; -- VMS + Name_Export_Function : constant Name_Id := N + 198; -- GNAT + Name_Export_Object : constant Name_Id := N + 199; -- GNAT + Name_Export_Procedure : constant Name_Id := N + 200; -- GNAT + Name_Export_Value : constant Name_Id := N + 201; -- GNAT + Name_Export_Valued_Procedure : constant Name_Id := N + 202; -- GNAT + Name_External : constant Name_Id := N + 203; -- GNAT + Name_Finalize_Storage_Only : constant Name_Id := N + 204; -- GNAT + Name_Ident : constant Name_Id := N + 205; -- VMS + Name_Implemented_By_Entry : constant Name_Id := N + 206; -- Ada 05 + Name_Import : constant Name_Id := N + 207; + Name_Import_Exception : constant Name_Id := N + 208; -- VMS + Name_Import_Function : constant Name_Id := N + 209; -- GNAT + Name_Import_Object : constant Name_Id := N + 210; -- GNAT + Name_Import_Procedure : constant Name_Id := N + 211; -- GNAT + Name_Import_Valued_Procedure : constant Name_Id := N + 212; -- GNAT + Name_Inline : constant Name_Id := N + 213; + Name_Inline_Always : constant Name_Id := N + 214; -- GNAT + Name_Inline_Generic : constant Name_Id := N + 215; -- GNAT + Name_Inspection_Point : constant Name_Id := N + 216; + Name_Interface_Name : constant Name_Id := N + 217; -- GNAT + Name_Interrupt_Handler : constant Name_Id := N + 218; + Name_Interrupt_Priority : constant Name_Id := N + 219; + Name_Java_Constructor : constant Name_Id := N + 220; -- GNAT + Name_Java_Interface : constant Name_Id := N + 221; -- GNAT + Name_Keep_Names : constant Name_Id := N + 222; -- GNAT + Name_Link_With : constant Name_Id := N + 223; -- GNAT + Name_Linker_Alias : constant Name_Id := N + 224; -- GNAT + Name_Linker_Constructor : constant Name_Id := N + 225; -- GNAT + Name_Linker_Destructor : constant Name_Id := N + 226; -- GNAT + Name_Linker_Options : constant Name_Id := N + 227; + Name_Linker_Section : constant Name_Id := N + 228; -- GNAT + Name_List : constant Name_Id := N + 229; + Name_Machine_Attribute : constant Name_Id := N + 230; -- GNAT + Name_Main : constant Name_Id := N + 231; -- GNAT + Name_Main_Storage : constant Name_Id := N + 232; -- GNAT + Name_Memory_Size : constant Name_Id := N + 233; -- Ada 83 + Name_No_Body : constant Name_Id := N + 234; -- GNAT + Name_No_Return : constant Name_Id := N + 235; -- GNAT + Name_Obsolescent : constant Name_Id := N + 236; -- GNAT + Name_Optimize : constant Name_Id := N + 237; + Name_Pack : constant Name_Id := N + 238; + Name_Page : constant Name_Id := N + 239; + Name_Passive : constant Name_Id := N + 240; -- GNAT + Name_Preelaborable_Initialization : constant Name_Id := N + 241; -- Ada 05 + Name_Preelaborate : constant Name_Id := N + 242; + Name_Preelaborate_05 : constant Name_Id := N + 243; -- GNAT -- Note: Priority is not in this list because its name matches -- the name of the corresponding attribute. However, it is @@ -484,15 +485,15 @@ package Snames is -- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize -- and process Priority. Priority is a standard Ada 95 pragma. - Name_Psect_Object : constant Name_Id := N + 243; -- VMS - Name_Pure : constant Name_Id := N + 244; - Name_Pure_05 : constant Name_Id := N + 245; -- GNAT - Name_Pure_Function : constant Name_Id := N + 246; -- GNAT - Name_Remote_Call_Interface : constant Name_Id := N + 247; - Name_Remote_Types : constant Name_Id := N + 248; - Name_Share_Generic : constant Name_Id := N + 249; -- GNAT - Name_Shared : constant Name_Id := N + 250; -- Ada 83 - Name_Shared_Passive : constant Name_Id := N + 251; + Name_Psect_Object : constant Name_Id := N + 244; -- VMS + Name_Pure : constant Name_Id := N + 245; + Name_Pure_05 : constant Name_Id := N + 246; -- GNAT + Name_Pure_Function : constant Name_Id := N + 247; -- GNAT + Name_Remote_Call_Interface : constant Name_Id := N + 248; + Name_Remote_Types : constant Name_Id := N + 249; + Name_Share_Generic : constant Name_Id := N + 250; -- GNAT + Name_Shared : constant Name_Id := N + 251; -- Ada 83 + Name_Shared_Passive : constant Name_Id := N + 252; -- Note: Storage_Size is not in this list because its name -- matches the name of the corresponding attribute. However, @@ -503,30 +504,30 @@ package Snames is -- Note: Storage_Unit is also omitted from the list because -- of a clash with an attribute name, and is treated similarly. - Name_Source_Reference : constant Name_Id := N + 252; -- GNAT - Name_Static_Elaboration_Desired : constant Name_Id := N + 253; -- GNAT - Name_Stream_Convert : constant Name_Id := N + 254; -- GNAT - Name_Subtitle : constant Name_Id := N + 255; -- GNAT - Name_Suppress_All : constant Name_Id := N + 256; -- GNAT - Name_Suppress_Debug_Info : constant Name_Id := N + 257; -- GNAT - Name_Suppress_Initialization : constant Name_Id := N + 258; -- GNAT - Name_System_Name : constant Name_Id := N + 259; -- Ada 83 - Name_Task_Info : constant Name_Id := N + 260; -- GNAT - Name_Task_Name : constant Name_Id := N + 261; -- GNAT - Name_Task_Storage : constant Name_Id := N + 262; -- VMS - Name_Time_Slice : constant Name_Id := N + 263; -- GNAT - Name_Title : constant Name_Id := N + 264; -- GNAT - Name_Unchecked_Union : constant Name_Id := N + 265; -- GNAT - Name_Unimplemented_Unit : constant Name_Id := N + 266; -- GNAT - Name_Universal_Aliasing : constant Name_Id := N + 267; -- GNAT - Name_Unmodified : constant Name_Id := N + 268; -- GNAT - Name_Unreferenced : constant Name_Id := N + 269; -- GNAT - Name_Unreferenced_Objects : constant Name_Id := N + 270; -- GNAT - Name_Unreserve_All_Interrupts : constant Name_Id := N + 271; -- GNAT - Name_Volatile : constant Name_Id := N + 272; - Name_Volatile_Components : constant Name_Id := N + 273; - Name_Weak_External : constant Name_Id := N + 274; -- GNAT - Last_Pragma_Name : constant Name_Id := N + 274; + Name_Source_Reference : constant Name_Id := N + 253; -- GNAT + Name_Static_Elaboration_Desired : constant Name_Id := N + 254; -- GNAT + Name_Stream_Convert : constant Name_Id := N + 255; -- GNAT + Name_Subtitle : constant Name_Id := N + 256; -- GNAT + Name_Suppress_All : constant Name_Id := N + 257; -- GNAT + Name_Suppress_Debug_Info : constant Name_Id := N + 258; -- GNAT + Name_Suppress_Initialization : constant Name_Id := N + 259; -- GNAT + Name_System_Name : constant Name_Id := N + 260; -- Ada 83 + Name_Task_Info : constant Name_Id := N + 261; -- GNAT + Name_Task_Name : constant Name_Id := N + 262; -- GNAT + Name_Task_Storage : constant Name_Id := N + 263; -- VMS + Name_Time_Slice : constant Name_Id := N + 264; -- GNAT + Name_Title : constant Name_Id := N + 265; -- GNAT + Name_Unchecked_Union : constant Name_Id := N + 266; -- GNAT + Name_Unimplemented_Unit : constant Name_Id := N + 267; -- GNAT + Name_Universal_Aliasing : constant Name_Id := N + 268; -- GNAT + Name_Unmodified : constant Name_Id := N + 269; -- GNAT + Name_Unreferenced : constant Name_Id := N + 270; -- GNAT + Name_Unreferenced_Objects : constant Name_Id := N + 271; -- GNAT + Name_Unreserve_All_Interrupts : constant Name_Id := N + 272; -- GNAT + Name_Volatile : constant Name_Id := N + 273; + Name_Volatile_Components : constant Name_Id := N + 274; + Name_Weak_External : constant Name_Id := N + 275; -- GNAT + Last_Pragma_Name : constant Name_Id := N + 275; -- Language convention names for pragma Convention/Export/Import/Interface -- Note that Name_C is not included in this list, since it was already @@ -537,119 +538,119 @@ package Snames is -- Entry and Protected, this is because these conventions cannot be -- specified by a pragma. - First_Convention_Name : constant Name_Id := N + 275; - Name_Ada : constant Name_Id := N + 275; - Name_Assembler : constant Name_Id := N + 276; - Name_CIL : constant Name_Id := N + 277; - Name_COBOL : constant Name_Id := N + 278; - Name_CPP : constant Name_Id := N + 279; - Name_Fortran : constant Name_Id := N + 280; - Name_Intrinsic : constant Name_Id := N + 281; - Name_Java : constant Name_Id := N + 282; - Name_Stdcall : constant Name_Id := N + 283; - Name_Stubbed : constant Name_Id := N + 284; - Last_Convention_Name : constant Name_Id := N + 284; + First_Convention_Name : constant Name_Id := N + 276; + Name_Ada : constant Name_Id := N + 276; + Name_Assembler : constant Name_Id := N + 277; + Name_CIL : constant Name_Id := N + 278; + Name_COBOL : constant Name_Id := N + 279; + Name_CPP : constant Name_Id := N + 280; + Name_Fortran : constant Name_Id := N + 281; + Name_Intrinsic : constant Name_Id := N + 282; + Name_Java : constant Name_Id := N + 283; + Name_Stdcall : constant Name_Id := N + 284; + Name_Stubbed : constant Name_Id := N + 285; + Last_Convention_Name : constant Name_Id := N + 285; -- The following names are preset as synonyms for Assembler - Name_Asm : constant Name_Id := N + 285; - Name_Assembly : constant Name_Id := N + 286; + Name_Asm : constant Name_Id := N + 286; + Name_Assembly : constant Name_Id := N + 287; -- The following names are preset as synonyms for C - Name_Default : constant Name_Id := N + 287; + Name_Default : constant Name_Id := N + 288; -- Name_Exernal (previously defined as pragma) -- The following names are preset as synonyms for CPP - Name_C_Plus_Plus : constant Name_Id := N + 288; + Name_C_Plus_Plus : constant Name_Id := N + 289; -- The following names are present as synonyms for Stdcall - Name_DLL : constant Name_Id := N + 289; - Name_Win32 : constant Name_Id := N + 290; + Name_DLL : constant Name_Id := N + 290; + Name_Win32 : constant Name_Id := N + 291; -- Other special names used in processing pragmas - Name_As_Is : constant Name_Id := N + 291; - Name_Attribute_Name : constant Name_Id := N + 292; - Name_Body_File_Name : constant Name_Id := N + 293; - Name_Boolean_Entry_Barriers : constant Name_Id := N + 294; - Name_Check : constant Name_Id := N + 295; - Name_Casing : constant Name_Id := N + 296; - Name_Code : constant Name_Id := N + 297; - Name_Component : constant Name_Id := N + 298; - Name_Component_Size_4 : constant Name_Id := N + 299; - Name_Copy : constant Name_Id := N + 300; - Name_D_Float : constant Name_Id := N + 301; - Name_Descriptor : constant Name_Id := N + 302; - Name_Dot_Replacement : constant Name_Id := N + 303; - Name_Dynamic : constant Name_Id := N + 304; - Name_Entity : constant Name_Id := N + 305; - Name_Entry_Count : constant Name_Id := N + 306; - Name_External_Name : constant Name_Id := N + 307; - Name_First_Optional_Parameter : constant Name_Id := N + 308; - Name_Form : constant Name_Id := N + 309; - Name_G_Float : constant Name_Id := N + 310; - Name_Gcc : constant Name_Id := N + 311; - Name_Gnat : constant Name_Id := N + 312; - Name_GPL : constant Name_Id := N + 313; - Name_IEEE_Float : constant Name_Id := N + 314; - Name_Ignore : constant Name_Id := N + 315; - Name_Info : constant Name_Id := N + 316; - Name_Internal : constant Name_Id := N + 317; - Name_Link_Name : constant Name_Id := N + 318; - Name_Lowercase : constant Name_Id := N + 319; - Name_Max_Entry_Queue_Depth : constant Name_Id := N + 320; - Name_Max_Entry_Queue_Length : constant Name_Id := N + 321; - Name_Max_Size : constant Name_Id := N + 322; - Name_Mechanism : constant Name_Id := N + 323; - Name_Message : constant Name_Id := N + 324; - Name_Mixedcase : constant Name_Id := N + 325; - Name_Modified_GPL : constant Name_Id := N + 326; - Name_Name : constant Name_Id := N + 327; - Name_NCA : constant Name_Id := N + 328; - Name_No : constant Name_Id := N + 329; - Name_No_Dependence : constant Name_Id := N + 330; - Name_No_Dynamic_Attachment : constant Name_Id := N + 331; - Name_No_Dynamic_Interrupts : constant Name_Id := N + 332; - Name_No_Requeue : constant Name_Id := N + 333; - Name_No_Requeue_Statements : constant Name_Id := N + 334; - Name_No_Task_Attributes : constant Name_Id := N + 335; - Name_No_Task_Attributes_Package : constant Name_Id := N + 336; - Name_On : constant Name_Id := N + 337; - Name_Parameter_Types : constant Name_Id := N + 338; - Name_Reference : constant Name_Id := N + 339; - Name_Restricted : constant Name_Id := N + 340; - Name_Result_Mechanism : constant Name_Id := N + 341; - Name_Result_Type : constant Name_Id := N + 342; - Name_Runtime : constant Name_Id := N + 343; - Name_SB : constant Name_Id := N + 344; - Name_Secondary_Stack_Size : constant Name_Id := N + 345; - Name_Section : constant Name_Id := N + 346; - Name_Semaphore : constant Name_Id := N + 347; - Name_Simple_Barriers : constant Name_Id := N + 348; - Name_Spec_File_Name : constant Name_Id := N + 349; - Name_State : constant Name_Id := N + 350; - Name_Static : constant Name_Id := N + 351; - Name_Stack_Size : constant Name_Id := N + 352; - Name_Subunit_File_Name : constant Name_Id := N + 353; - Name_Task_Stack_Size_Default : constant Name_Id := N + 354; - Name_Task_Type : constant Name_Id := N + 355; - Name_Time_Slicing_Enabled : constant Name_Id := N + 356; - Name_Top_Guard : constant Name_Id := N + 357; - Name_UBA : constant Name_Id := N + 358; - Name_UBS : constant Name_Id := N + 359; - Name_UBSB : constant Name_Id := N + 360; - Name_Unit_Name : constant Name_Id := N + 361; - Name_Unknown : constant Name_Id := N + 362; - Name_Unrestricted : constant Name_Id := N + 363; - Name_Uppercase : constant Name_Id := N + 364; - Name_User : constant Name_Id := N + 365; - Name_VAX_Float : constant Name_Id := N + 366; - Name_VMS : constant Name_Id := N + 367; - Name_Vtable_Ptr : constant Name_Id := N + 368; - Name_Working_Storage : constant Name_Id := N + 369; + Name_As_Is : constant Name_Id := N + 292; + Name_Attribute_Name : constant Name_Id := N + 293; + Name_Body_File_Name : constant Name_Id := N + 294; + Name_Boolean_Entry_Barriers : constant Name_Id := N + 295; + Name_Check : constant Name_Id := N + 296; + Name_Casing : constant Name_Id := N + 297; + Name_Code : constant Name_Id := N + 298; + Name_Component : constant Name_Id := N + 299; + Name_Component_Size_4 : constant Name_Id := N + 300; + Name_Copy : constant Name_Id := N + 301; + Name_D_Float : constant Name_Id := N + 302; + Name_Descriptor : constant Name_Id := N + 303; + Name_Dot_Replacement : constant Name_Id := N + 304; + Name_Dynamic : constant Name_Id := N + 305; + Name_Entity : constant Name_Id := N + 306; + Name_Entry_Count : constant Name_Id := N + 307; + Name_External_Name : constant Name_Id := N + 308; + Name_First_Optional_Parameter : constant Name_Id := N + 309; + Name_Form : constant Name_Id := N + 310; + Name_G_Float : constant Name_Id := N + 311; + Name_Gcc : constant Name_Id := N + 312; + Name_Gnat : constant Name_Id := N + 313; + Name_GPL : constant Name_Id := N + 314; + Name_IEEE_Float : constant Name_Id := N + 315; + Name_Ignore : constant Name_Id := N + 316; + Name_Info : constant Name_Id := N + 317; + Name_Internal : constant Name_Id := N + 318; + Name_Link_Name : constant Name_Id := N + 319; + Name_Lowercase : constant Name_Id := N + 320; + Name_Max_Entry_Queue_Depth : constant Name_Id := N + 321; + Name_Max_Entry_Queue_Length : constant Name_Id := N + 322; + Name_Max_Size : constant Name_Id := N + 323; + Name_Mechanism : constant Name_Id := N + 324; + Name_Message : constant Name_Id := N + 325; + Name_Mixedcase : constant Name_Id := N + 326; + Name_Modified_GPL : constant Name_Id := N + 327; + Name_Name : constant Name_Id := N + 328; + Name_NCA : constant Name_Id := N + 329; + Name_No : constant Name_Id := N + 330; + Name_No_Dependence : constant Name_Id := N + 331; + Name_No_Dynamic_Attachment : constant Name_Id := N + 332; + Name_No_Dynamic_Interrupts : constant Name_Id := N + 333; + Name_No_Requeue : constant Name_Id := N + 334; + Name_No_Requeue_Statements : constant Name_Id := N + 335; + Name_No_Task_Attributes : constant Name_Id := N + 336; + Name_No_Task_Attributes_Package : constant Name_Id := N + 337; + Name_On : constant Name_Id := N + 338; + Name_Parameter_Types : constant Name_Id := N + 339; + Name_Reference : constant Name_Id := N + 340; + Name_Restricted : constant Name_Id := N + 341; + Name_Result_Mechanism : constant Name_Id := N + 342; + Name_Result_Type : constant Name_Id := N + 343; + Name_Runtime : constant Name_Id := N + 344; + Name_SB : constant Name_Id := N + 345; + Name_Secondary_Stack_Size : constant Name_Id := N + 346; + Name_Section : constant Name_Id := N + 347; + Name_Semaphore : constant Name_Id := N + 348; + Name_Simple_Barriers : constant Name_Id := N + 349; + Name_Spec_File_Name : constant Name_Id := N + 350; + Name_State : constant Name_Id := N + 351; + Name_Static : constant Name_Id := N + 352; + Name_Stack_Size : constant Name_Id := N + 353; + Name_Subunit_File_Name : constant Name_Id := N + 354; + Name_Task_Stack_Size_Default : constant Name_Id := N + 355; + Name_Task_Type : constant Name_Id := N + 356; + Name_Time_Slicing_Enabled : constant Name_Id := N + 357; + Name_Top_Guard : constant Name_Id := N + 358; + Name_UBA : constant Name_Id := N + 359; + Name_UBS : constant Name_Id := N + 360; + Name_UBSB : constant Name_Id := N + 361; + Name_Unit_Name : constant Name_Id := N + 362; + Name_Unknown : constant Name_Id := N + 363; + Name_Unrestricted : constant Name_Id := N + 364; + Name_Uppercase : constant Name_Id := N + 365; + Name_User : constant Name_Id := N + 366; + Name_VAX_Float : constant Name_Id := N + 367; + Name_VMS : constant Name_Id := N + 368; + Name_Vtable_Ptr : constant Name_Id := N + 369; + Name_Working_Storage : constant Name_Id := N + 370; -- Names of recognized attributes. The entries with the comment "Ada 83" -- are attributes that are defined in Ada 83, but not in Ada 95. These @@ -663,170 +664,171 @@ package Snames is -- The entries marked VMS are recognized only in OpenVMS implementations -- of GNAT, and are treated as illegal in all other contexts. - First_Attribute_Name : constant Name_Id := N + 370; - Name_Abort_Signal : constant Name_Id := N + 370; -- GNAT - Name_Access : constant Name_Id := N + 371; - Name_Address : constant Name_Id := N + 372; - Name_Address_Size : constant Name_Id := N + 373; -- GNAT - Name_Aft : constant Name_Id := N + 374; - Name_Alignment : constant Name_Id := N + 375; - Name_Asm_Input : constant Name_Id := N + 376; -- GNAT - Name_Asm_Output : constant Name_Id := N + 377; -- GNAT - Name_AST_Entry : constant Name_Id := N + 378; -- VMS - Name_Bit : constant Name_Id := N + 379; -- GNAT - Name_Bit_Order : constant Name_Id := N + 380; - Name_Bit_Position : constant Name_Id := N + 381; -- GNAT - Name_Body_Version : constant Name_Id := N + 382; - Name_Callable : constant Name_Id := N + 383; - Name_Caller : constant Name_Id := N + 384; - Name_Code_Address : constant Name_Id := N + 385; -- GNAT - Name_Component_Size : constant Name_Id := N + 386; - Name_Compose : constant Name_Id := N + 387; - Name_Constrained : constant Name_Id := N + 388; - Name_Count : constant Name_Id := N + 389; - Name_Default_Bit_Order : constant Name_Id := N + 390; -- GNAT - Name_Definite : constant Name_Id := N + 391; - Name_Delta : constant Name_Id := N + 392; - Name_Denorm : constant Name_Id := N + 393; - Name_Digits : constant Name_Id := N + 394; - Name_Elaborated : constant Name_Id := N + 395; -- GNAT - Name_Emax : constant Name_Id := N + 396; -- Ada 83 - Name_Enabled : constant Name_Id := N + 397; -- GNAT - Name_Enum_Rep : constant Name_Id := N + 398; -- GNAT - Name_Epsilon : constant Name_Id := N + 399; -- Ada 83 - Name_Exponent : constant Name_Id := N + 400; - Name_External_Tag : constant Name_Id := N + 401; - Name_Fast_Math : constant Name_Id := N + 402; -- GNAT - Name_First : constant Name_Id := N + 403; - Name_First_Bit : constant Name_Id := N + 404; - Name_Fixed_Value : constant Name_Id := N + 405; -- GNAT - Name_Fore : constant Name_Id := N + 406; - Name_Has_Access_Values : constant Name_Id := N + 407; -- GNAT - Name_Has_Discriminants : constant Name_Id := N + 408; -- GNAT - Name_Identity : constant Name_Id := N + 409; - Name_Img : constant Name_Id := N + 410; -- GNAT - Name_Integer_Value : constant Name_Id := N + 411; -- GNAT - Name_Large : constant Name_Id := N + 412; -- Ada 83 - Name_Last : constant Name_Id := N + 413; - Name_Last_Bit : constant Name_Id := N + 414; - Name_Leading_Part : constant Name_Id := N + 415; - Name_Length : constant Name_Id := N + 416; - Name_Machine_Emax : constant Name_Id := N + 417; - Name_Machine_Emin : constant Name_Id := N + 418; - Name_Machine_Mantissa : constant Name_Id := N + 419; - Name_Machine_Overflows : constant Name_Id := N + 420; - Name_Machine_Radix : constant Name_Id := N + 421; - Name_Machine_Rounding : constant Name_Id := N + 422; -- Ada 05 - Name_Machine_Rounds : constant Name_Id := N + 423; - Name_Machine_Size : constant Name_Id := N + 424; -- GNAT - Name_Mantissa : constant Name_Id := N + 425; -- Ada 83 - Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 426; - Name_Maximum_Alignment : constant Name_Id := N + 427; -- GNAT - Name_Mechanism_Code : constant Name_Id := N + 428; -- GNAT - Name_Mod : constant Name_Id := N + 429; -- Ada 05 - Name_Model_Emin : constant Name_Id := N + 430; - Name_Model_Epsilon : constant Name_Id := N + 431; - Name_Model_Mantissa : constant Name_Id := N + 432; - Name_Model_Small : constant Name_Id := N + 433; - Name_Modulus : constant Name_Id := N + 434; - Name_Null_Parameter : constant Name_Id := N + 435; -- GNAT - Name_Object_Size : constant Name_Id := N + 436; -- GNAT - Name_Partition_ID : constant Name_Id := N + 437; - Name_Passed_By_Reference : constant Name_Id := N + 438; -- GNAT - Name_Pool_Address : constant Name_Id := N + 439; - Name_Pos : constant Name_Id := N + 440; - Name_Position : constant Name_Id := N + 441; - Name_Priority : constant Name_Id := N + 442; -- Ada 05 - Name_Range : constant Name_Id := N + 443; - Name_Range_Length : constant Name_Id := N + 444; -- GNAT - Name_Round : constant Name_Id := N + 445; - Name_Safe_Emax : constant Name_Id := N + 446; -- Ada 83 - Name_Safe_First : constant Name_Id := N + 447; - Name_Safe_Large : constant Name_Id := N + 448; -- Ada 83 - Name_Safe_Last : constant Name_Id := N + 449; - Name_Safe_Small : constant Name_Id := N + 450; -- Ada 83 - Name_Scale : constant Name_Id := N + 451; - Name_Scaling : constant Name_Id := N + 452; - Name_Signed_Zeros : constant Name_Id := N + 453; - Name_Size : constant Name_Id := N + 454; - Name_Small : constant Name_Id := N + 455; - Name_Storage_Size : constant Name_Id := N + 456; - Name_Storage_Unit : constant Name_Id := N + 457; -- GNAT - Name_Stream_Size : constant Name_Id := N + 458; -- Ada 05 - Name_Tag : constant Name_Id := N + 459; - Name_Target_Name : constant Name_Id := N + 460; -- GNAT - Name_Terminated : constant Name_Id := N + 461; - Name_To_Address : constant Name_Id := N + 462; -- GNAT - Name_Type_Class : constant Name_Id := N + 463; -- GNAT - Name_UET_Address : constant Name_Id := N + 464; -- GNAT - Name_Unbiased_Rounding : constant Name_Id := N + 465; - Name_Unchecked_Access : constant Name_Id := N + 466; - Name_Unconstrained_Array : constant Name_Id := N + 467; - Name_Universal_Literal_String : constant Name_Id := N + 468; -- GNAT - Name_Unrestricted_Access : constant Name_Id := N + 469; -- GNAT - Name_VADS_Size : constant Name_Id := N + 470; -- GNAT - Name_Val : constant Name_Id := N + 471; - Name_Valid : constant Name_Id := N + 472; - Name_Value_Size : constant Name_Id := N + 473; -- GNAT - Name_Version : constant Name_Id := N + 474; - Name_Wchar_T_Size : constant Name_Id := N + 475; -- GNAT - Name_Wide_Wide_Width : constant Name_Id := N + 476; -- Ada 05 - Name_Wide_Width : constant Name_Id := N + 477; - Name_Width : constant Name_Id := N + 478; - Name_Word_Size : constant Name_Id := N + 479; -- GNAT + First_Attribute_Name : constant Name_Id := N + 371; + Name_Abort_Signal : constant Name_Id := N + 371; -- GNAT + Name_Access : constant Name_Id := N + 372; + Name_Address : constant Name_Id := N + 373; + Name_Address_Size : constant Name_Id := N + 374; -- GNAT + Name_Aft : constant Name_Id := N + 375; + Name_Alignment : constant Name_Id := N + 376; + Name_Asm_Input : constant Name_Id := N + 377; -- GNAT + Name_Asm_Output : constant Name_Id := N + 378; -- GNAT + Name_AST_Entry : constant Name_Id := N + 379; -- VMS + Name_Bit : constant Name_Id := N + 380; -- GNAT + Name_Bit_Order : constant Name_Id := N + 381; + Name_Bit_Position : constant Name_Id := N + 382; -- GNAT + Name_Body_Version : constant Name_Id := N + 383; + Name_Callable : constant Name_Id := N + 384; + Name_Caller : constant Name_Id := N + 385; + Name_Code_Address : constant Name_Id := N + 386; -- GNAT + Name_Component_Size : constant Name_Id := N + 387; + Name_Compose : constant Name_Id := N + 388; + Name_Constrained : constant Name_Id := N + 389; + Name_Count : constant Name_Id := N + 390; + Name_Default_Bit_Order : constant Name_Id := N + 391; -- GNAT + Name_Definite : constant Name_Id := N + 392; + Name_Delta : constant Name_Id := N + 393; + Name_Denorm : constant Name_Id := N + 394; + Name_Digits : constant Name_Id := N + 395; + Name_Elaborated : constant Name_Id := N + 396; -- GNAT + Name_Emax : constant Name_Id := N + 397; -- Ada 83 + Name_Enabled : constant Name_Id := N + 398; -- GNAT + Name_Enum_Rep : constant Name_Id := N + 399; -- GNAT + Name_Epsilon : constant Name_Id := N + 400; -- Ada 83 + Name_Exponent : constant Name_Id := N + 401; + Name_External_Tag : constant Name_Id := N + 402; + Name_Fast_Math : constant Name_Id := N + 403; -- GNAT + Name_First : constant Name_Id := N + 404; + Name_First_Bit : constant Name_Id := N + 405; + Name_Fixed_Value : constant Name_Id := N + 406; -- GNAT + Name_Fore : constant Name_Id := N + 407; + Name_Has_Access_Values : constant Name_Id := N + 408; -- GNAT + Name_Has_Discriminants : constant Name_Id := N + 409; -- GNAT + Name_Identity : constant Name_Id := N + 410; + Name_Img : constant Name_Id := N + 411; -- GNAT + Name_Integer_Value : constant Name_Id := N + 412; -- GNAT + Name_Large : constant Name_Id := N + 413; -- Ada 83 + Name_Last : constant Name_Id := N + 414; + Name_Last_Bit : constant Name_Id := N + 415; + Name_Leading_Part : constant Name_Id := N + 416; + Name_Length : constant Name_Id := N + 417; + Name_Machine_Emax : constant Name_Id := N + 418; + Name_Machine_Emin : constant Name_Id := N + 419; + Name_Machine_Mantissa : constant Name_Id := N + 420; + Name_Machine_Overflows : constant Name_Id := N + 421; + Name_Machine_Radix : constant Name_Id := N + 422; + Name_Machine_Rounding : constant Name_Id := N + 423; -- Ada 05 + Name_Machine_Rounds : constant Name_Id := N + 424; + Name_Machine_Size : constant Name_Id := N + 425; -- GNAT + Name_Mantissa : constant Name_Id := N + 426; -- Ada 83 + Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 427; + Name_Maximum_Alignment : constant Name_Id := N + 428; -- GNAT + Name_Mechanism_Code : constant Name_Id := N + 429; -- GNAT + Name_Mod : constant Name_Id := N + 430; -- Ada 05 + Name_Model_Emin : constant Name_Id := N + 431; + Name_Model_Epsilon : constant Name_Id := N + 432; + Name_Model_Mantissa : constant Name_Id := N + 433; + Name_Model_Small : constant Name_Id := N + 434; + Name_Modulus : constant Name_Id := N + 435; + Name_Null_Parameter : constant Name_Id := N + 436; -- GNAT + Name_Object_Size : constant Name_Id := N + 437; -- GNAT + Name_Old : constant Name_Id := N + 438; -- GNAT + Name_Partition_ID : constant Name_Id := N + 439; + Name_Passed_By_Reference : constant Name_Id := N + 440; -- GNAT + Name_Pool_Address : constant Name_Id := N + 441; + Name_Pos : constant Name_Id := N + 442; + Name_Position : constant Name_Id := N + 443; + Name_Priority : constant Name_Id := N + 444; -- Ada 05 + Name_Range : constant Name_Id := N + 445; + Name_Range_Length : constant Name_Id := N + 446; -- GNAT + Name_Round : constant Name_Id := N + 447; + Name_Safe_Emax : constant Name_Id := N + 448; -- Ada 83 + Name_Safe_First : constant Name_Id := N + 449; + Name_Safe_Large : constant Name_Id := N + 450; -- Ada 83 + Name_Safe_Last : constant Name_Id := N + 451; + Name_Safe_Small : constant Name_Id := N + 452; -- Ada 83 + Name_Scale : constant Name_Id := N + 453; + Name_Scaling : constant Name_Id := N + 454; + Name_Signed_Zeros : constant Name_Id := N + 455; + Name_Size : constant Name_Id := N + 456; + Name_Small : constant Name_Id := N + 457; + Name_Storage_Size : constant Name_Id := N + 458; + Name_Storage_Unit : constant Name_Id := N + 459; -- GNAT + Name_Stream_Size : constant Name_Id := N + 460; -- Ada 05 + Name_Tag : constant Name_Id := N + 461; + Name_Target_Name : constant Name_Id := N + 462; -- GNAT + Name_Terminated : constant Name_Id := N + 463; + Name_To_Address : constant Name_Id := N + 464; -- GNAT + Name_Type_Class : constant Name_Id := N + 465; -- GNAT + Name_UET_Address : constant Name_Id := N + 466; -- GNAT + Name_Unbiased_Rounding : constant Name_Id := N + 467; + Name_Unchecked_Access : constant Name_Id := N + 468; + Name_Unconstrained_Array : constant Name_Id := N + 469; + Name_Universal_Literal_String : constant Name_Id := N + 470; -- GNAT + Name_Unrestricted_Access : constant Name_Id := N + 471; -- GNAT + Name_VADS_Size : constant Name_Id := N + 472; -- GNAT + Name_Val : constant Name_Id := N + 473; + Name_Valid : constant Name_Id := N + 474; + Name_Value_Size : constant Name_Id := N + 475; -- GNAT + Name_Version : constant Name_Id := N + 476; + Name_Wchar_T_Size : constant Name_Id := N + 477; -- GNAT + Name_Wide_Wide_Width : constant Name_Id := N + 478; -- Ada 05 + Name_Wide_Width : constant Name_Id := N + 479; + Name_Width : constant Name_Id := N + 480; + Name_Word_Size : constant Name_Id := N + 481; -- GNAT -- Attributes that designate attributes returning renamable functions, -- i.e. functions that return other than a universal value and that -- have non-universal arguments. - First_Renamable_Function_Attribute : constant Name_Id := N + 480; - Name_Adjacent : constant Name_Id := N + 480; - Name_Ceiling : constant Name_Id := N + 481; - Name_Copy_Sign : constant Name_Id := N + 482; - Name_Floor : constant Name_Id := N + 483; - Name_Fraction : constant Name_Id := N + 484; - Name_Image : constant Name_Id := N + 485; - Name_Input : constant Name_Id := N + 486; - Name_Machine : constant Name_Id := N + 487; - Name_Max : constant Name_Id := N + 488; - Name_Min : constant Name_Id := N + 489; - Name_Model : constant Name_Id := N + 490; - Name_Pred : constant Name_Id := N + 491; - Name_Remainder : constant Name_Id := N + 492; - Name_Rounding : constant Name_Id := N + 493; - Name_Succ : constant Name_Id := N + 494; - Name_Truncation : constant Name_Id := N + 495; - Name_Value : constant Name_Id := N + 496; - Name_Wide_Image : constant Name_Id := N + 497; - Name_Wide_Wide_Image : constant Name_Id := N + 498; - Name_Wide_Value : constant Name_Id := N + 499; - Name_Wide_Wide_Value : constant Name_Id := N + 500; - Last_Renamable_Function_Attribute : constant Name_Id := N + 500; + First_Renamable_Function_Attribute : constant Name_Id := N + 482; + Name_Adjacent : constant Name_Id := N + 482; + Name_Ceiling : constant Name_Id := N + 483; + Name_Copy_Sign : constant Name_Id := N + 484; + Name_Floor : constant Name_Id := N + 485; + Name_Fraction : constant Name_Id := N + 486; + Name_Image : constant Name_Id := N + 487; + Name_Input : constant Name_Id := N + 488; + Name_Machine : constant Name_Id := N + 489; + Name_Max : constant Name_Id := N + 490; + Name_Min : constant Name_Id := N + 491; + Name_Model : constant Name_Id := N + 492; + Name_Pred : constant Name_Id := N + 493; + Name_Remainder : constant Name_Id := N + 494; + Name_Rounding : constant Name_Id := N + 495; + Name_Succ : constant Name_Id := N + 496; + Name_Truncation : constant Name_Id := N + 497; + Name_Value : constant Name_Id := N + 498; + Name_Wide_Image : constant Name_Id := N + 499; + Name_Wide_Wide_Image : constant Name_Id := N + 500; + Name_Wide_Value : constant Name_Id := N + 501; + Name_Wide_Wide_Value : constant Name_Id := N + 502; + Last_Renamable_Function_Attribute : constant Name_Id := N + 502; -- Attributes that designate procedures - First_Procedure_Attribute : constant Name_Id := N + 501; - Name_Output : constant Name_Id := N + 501; - Name_Read : constant Name_Id := N + 502; - Name_Write : constant Name_Id := N + 503; - Last_Procedure_Attribute : constant Name_Id := N + 503; + First_Procedure_Attribute : constant Name_Id := N + 503; + Name_Output : constant Name_Id := N + 503; + Name_Read : constant Name_Id := N + 504; + Name_Write : constant Name_Id := N + 505; + Last_Procedure_Attribute : constant Name_Id := N + 505; -- Remaining attributes are ones that return entities - First_Entity_Attribute_Name : constant Name_Id := N + 504; - Name_Elab_Body : constant Name_Id := N + 504; -- GNAT - Name_Elab_Spec : constant Name_Id := N + 505; -- GNAT - Name_Storage_Pool : constant Name_Id := N + 506; + First_Entity_Attribute_Name : constant Name_Id := N + 506; + Name_Elab_Body : constant Name_Id := N + 506; -- GNAT + Name_Elab_Spec : constant Name_Id := N + 507; -- GNAT + Name_Storage_Pool : constant Name_Id := N + 508; -- These attributes are the ones that return types - First_Type_Attribute_Name : constant Name_Id := N + 507; - Name_Base : constant Name_Id := N + 507; - Name_Class : constant Name_Id := N + 508; - Name_Stub_Type : constant Name_Id := N + 509; - Last_Type_Attribute_Name : constant Name_Id := N + 509; - Last_Entity_Attribute_Name : constant Name_Id := N + 509; - Last_Attribute_Name : constant Name_Id := N + 509; + First_Type_Attribute_Name : constant Name_Id := N + 509; + Name_Base : constant Name_Id := N + 509; + Name_Class : constant Name_Id := N + 510; + Name_Stub_Type : constant Name_Id := N + 511; + Last_Type_Attribute_Name : constant Name_Id := N + 511; + Last_Entity_Attribute_Name : constant Name_Id := N + 511; + Last_Attribute_Name : constant Name_Id := N + 511; -- Names of recognized locking policy identifiers @@ -834,10 +836,10 @@ package Snames is -- name (e.g. C for Ceiling_Locking). If new policy names are added, -- the first character must be distinct. - First_Locking_Policy_Name : constant Name_Id := N + 510; - Name_Ceiling_Locking : constant Name_Id := N + 510; - Name_Inheritance_Locking : constant Name_Id := N + 511; - Last_Locking_Policy_Name : constant Name_Id := N + 511; + First_Locking_Policy_Name : constant Name_Id := N + 512; + Name_Ceiling_Locking : constant Name_Id := N + 512; + Name_Inheritance_Locking : constant Name_Id := N + 513; + Last_Locking_Policy_Name : constant Name_Id := N + 513; -- Names of recognized queuing policy identifiers @@ -845,10 +847,10 @@ package Snames is -- name (e.g. F for FIFO_Queuing). If new policy names are added, -- the first character must be distinct. - First_Queuing_Policy_Name : constant Name_Id := N + 512; - Name_FIFO_Queuing : constant Name_Id := N + 512; - Name_Priority_Queuing : constant Name_Id := N + 513; - Last_Queuing_Policy_Name : constant Name_Id := N + 513; + First_Queuing_Policy_Name : constant Name_Id := N + 514; + Name_FIFO_Queuing : constant Name_Id := N + 514; + Name_Priority_Queuing : constant Name_Id := N + 515; + Last_Queuing_Policy_Name : constant Name_Id := N + 515; -- Names of recognized task dispatching policy identifiers @@ -856,273 +858,275 @@ package Snames is -- name (e.g. F for FIFO_Within_Priorities). If new policy names -- are added, the first character must be distinct. - First_Task_Dispatching_Policy_Name : constant Name_Id := N + 514; - Name_EDF_Across_Priorities : constant Name_Id := N + 514; - Name_FIFO_Within_Priorities : constant Name_Id := N + 515; + First_Task_Dispatching_Policy_Name : constant Name_Id := N + 516; + Name_EDF_Across_Priorities : constant Name_Id := N + 516; + Name_FIFO_Within_Priorities : constant Name_Id := N + 517; Name_Non_Preemptive_Within_Priorities : constant Name_Id := N + 513; - Name_Round_Robin_Within_Priorities : constant Name_Id := N + 516; - Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 516; + Name_Round_Robin_Within_Priorities : constant Name_Id := N + 518; + Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 518; -- Names of recognized checks for pragma Suppress - First_Check_Name : constant Name_Id := N + 517; - Name_Access_Check : constant Name_Id := N + 517; - Name_Accessibility_Check : constant Name_Id := N + 518; - Name_Alignment_Check : constant Name_Id := N + 519; -- GNAT - Name_Discriminant_Check : constant Name_Id := N + 520; - Name_Division_Check : constant Name_Id := N + 521; - Name_Elaboration_Check : constant Name_Id := N + 522; - Name_Index_Check : constant Name_Id := N + 523; - Name_Length_Check : constant Name_Id := N + 524; - Name_Overflow_Check : constant Name_Id := N + 525; - Name_Range_Check : constant Name_Id := N + 526; - Name_Storage_Check : constant Name_Id := N + 527; - Name_Tag_Check : constant Name_Id := N + 528; - Name_Validity_Check : constant Name_Id := N + 529; -- GNAT - Name_All_Checks : constant Name_Id := N + 530; - Last_Check_Name : constant Name_Id := N + 530; + First_Check_Name : constant Name_Id := N + 519; + Name_Access_Check : constant Name_Id := N + 519; + Name_Accessibility_Check : constant Name_Id := N + 520; + Name_Alignment_Check : constant Name_Id := N + 521; -- GNAT + Name_Discriminant_Check : constant Name_Id := N + 522; + Name_Division_Check : constant Name_Id := N + 523; + Name_Elaboration_Check : constant Name_Id := N + 524; + Name_Index_Check : constant Name_Id := N + 525; + Name_Length_Check : constant Name_Id := N + 526; + Name_Overflow_Check : constant Name_Id := N + 527; + Name_Range_Check : constant Name_Id := N + 528; + Name_Storage_Check : constant Name_Id := N + 529; + Name_Tag_Check : constant Name_Id := N + 530; + Name_Validity_Check : constant Name_Id := N + 531; -- GNAT + Name_All_Checks : constant Name_Id := N + 532; + Last_Check_Name : constant Name_Id := N + 532; -- Names corresponding to reserved keywords, excluding those already -- declared in the attribute list (Access, Delta, Digits, Mod, Range). - Name_Abort : constant Name_Id := N + 531; - Name_Abs : constant Name_Id := N + 532; - Name_Accept : constant Name_Id := N + 533; - Name_And : constant Name_Id := N + 534; - Name_All : constant Name_Id := N + 535; - Name_Array : constant Name_Id := N + 536; - Name_At : constant Name_Id := N + 537; - Name_Begin : constant Name_Id := N + 538; - Name_Body : constant Name_Id := N + 539; - Name_Case : constant Name_Id := N + 540; - Name_Constant : constant Name_Id := N + 541; - Name_Declare : constant Name_Id := N + 542; - Name_Delay : constant Name_Id := N + 543; - Name_Do : constant Name_Id := N + 544; - Name_Else : constant Name_Id := N + 545; - Name_Elsif : constant Name_Id := N + 546; - Name_End : constant Name_Id := N + 547; - Name_Entry : constant Name_Id := N + 548; - Name_Exception : constant Name_Id := N + 549; - Name_Exit : constant Name_Id := N + 550; - Name_For : constant Name_Id := N + 551; - Name_Function : constant Name_Id := N + 552; - Name_Generic : constant Name_Id := N + 553; - Name_Goto : constant Name_Id := N + 554; - Name_If : constant Name_Id := N + 555; - Name_In : constant Name_Id := N + 556; - Name_Is : constant Name_Id := N + 557; - Name_Limited : constant Name_Id := N + 558; - Name_Loop : constant Name_Id := N + 559; - Name_New : constant Name_Id := N + 560; - Name_Not : constant Name_Id := N + 561; - Name_Null : constant Name_Id := N + 562; - Name_Of : constant Name_Id := N + 563; - Name_Or : constant Name_Id := N + 564; - Name_Others : constant Name_Id := N + 565; - Name_Out : constant Name_Id := N + 566; - Name_Package : constant Name_Id := N + 567; - Name_Pragma : constant Name_Id := N + 568; - Name_Private : constant Name_Id := N + 569; - Name_Procedure : constant Name_Id := N + 570; - Name_Raise : constant Name_Id := N + 571; - Name_Record : constant Name_Id := N + 572; - Name_Rem : constant Name_Id := N + 573; - Name_Renames : constant Name_Id := N + 574; - Name_Return : constant Name_Id := N + 575; - Name_Reverse : constant Name_Id := N + 576; - Name_Select : constant Name_Id := N + 577; - Name_Separate : constant Name_Id := N + 578; - Name_Subtype : constant Name_Id := N + 579; - Name_Task : constant Name_Id := N + 580; - Name_Terminate : constant Name_Id := N + 581; - Name_Then : constant Name_Id := N + 582; - Name_Type : constant Name_Id := N + 583; - Name_Use : constant Name_Id := N + 584; - Name_When : constant Name_Id := N + 585; - Name_While : constant Name_Id := N + 586; - Name_With : constant Name_Id := N + 587; - Name_Xor : constant Name_Id := N + 588; + Name_Abort : constant Name_Id := N + 533; + Name_Abs : constant Name_Id := N + 534; + Name_Accept : constant Name_Id := N + 535; + Name_And : constant Name_Id := N + 536; + Name_All : constant Name_Id := N + 537; + Name_Array : constant Name_Id := N + 538; + Name_At : constant Name_Id := N + 539; + Name_Begin : constant Name_Id := N + 540; + Name_Body : constant Name_Id := N + 541; + Name_Case : constant Name_Id := N + 542; + Name_Constant : constant Name_Id := N + 543; + Name_Declare : constant Name_Id := N + 544; + Name_Delay : constant Name_Id := N + 545; + Name_Do : constant Name_Id := N + 546; + Name_Else : constant Name_Id := N + 547; + Name_Elsif : constant Name_Id := N + 548; + Name_End : constant Name_Id := N + 549; + Name_Entry : constant Name_Id := N + 550; + Name_Exception : constant Name_Id := N + 551; + Name_Exit : constant Name_Id := N + 552; + Name_For : constant Name_Id := N + 553; + Name_Function : constant Name_Id := N + 554; + Name_Generic : constant Name_Id := N + 555; + Name_Goto : constant Name_Id := N + 556; + Name_If : constant Name_Id := N + 557; + Name_In : constant Name_Id := N + 558; + Name_Is : constant Name_Id := N + 559; + Name_Limited : constant Name_Id := N + 560; + Name_Loop : constant Name_Id := N + 561; + Name_New : constant Name_Id := N + 562; + Name_Not : constant Name_Id := N + 563; + Name_Null : constant Name_Id := N + 564; + Name_Of : constant Name_Id := N + 565; + Name_Or : constant Name_Id := N + 566; + Name_Others : constant Name_Id := N + 567; + Name_Out : constant Name_Id := N + 568; + Name_Package : constant Name_Id := N + 569; + Name_Pragma : constant Name_Id := N + 570; + Name_Private : constant Name_Id := N + 571; + Name_Procedure : constant Name_Id := N + 572; + Name_Raise : constant Name_Id := N + 573; + Name_Record : constant Name_Id := N + 574; + Name_Rem : constant Name_Id := N + 575; + Name_Renames : constant Name_Id := N + 576; + Name_Return : constant Name_Id := N + 577; + Name_Reverse : constant Name_Id := N + 578; + Name_Select : constant Name_Id := N + 579; + Name_Separate : constant Name_Id := N + 580; + Name_Subtype : constant Name_Id := N + 581; + Name_Task : constant Name_Id := N + 582; + Name_Terminate : constant Name_Id := N + 583; + Name_Then : constant Name_Id := N + 584; + Name_Type : constant Name_Id := N + 585; + Name_Use : constant Name_Id := N + 586; + Name_When : constant Name_Id := N + 587; + Name_While : constant Name_Id := N + 588; + Name_With : constant Name_Id := N + 589; + Name_Xor : constant Name_Id := N + 590; -- Names of intrinsic subprograms -- Note: Asm is missing from this list, since Asm is a legitimate -- convention name. So is To_Adress, which is a GNAT attribute. - First_Intrinsic_Name : constant Name_Id := N + 589; - Name_Divide : constant Name_Id := N + 589; - Name_Enclosing_Entity : constant Name_Id := N + 590; - Name_Exception_Information : constant Name_Id := N + 591; - Name_Exception_Message : constant Name_Id := N + 592; - Name_Exception_Name : constant Name_Id := N + 593; - Name_File : constant Name_Id := N + 594; - Name_Generic_Dispatching_Constructor : constant Name_Id := N + 595; - Name_Import_Address : constant Name_Id := N + 596; - Name_Import_Largest_Value : constant Name_Id := N + 597; - Name_Import_Value : constant Name_Id := N + 598; - Name_Is_Negative : constant Name_Id := N + 599; - Name_Line : constant Name_Id := N + 600; - Name_Rotate_Left : constant Name_Id := N + 601; - Name_Rotate_Right : constant Name_Id := N + 602; - Name_Shift_Left : constant Name_Id := N + 603; - Name_Shift_Right : constant Name_Id := N + 604; - Name_Shift_Right_Arithmetic : constant Name_Id := N + 605; - Name_Source_Location : constant Name_Id := N + 606; - Name_Unchecked_Conversion : constant Name_Id := N + 607; - Name_Unchecked_Deallocation : constant Name_Id := N + 608; - Name_To_Pointer : constant Name_Id := N + 609; - Last_Intrinsic_Name : constant Name_Id := N + 609; + First_Intrinsic_Name : constant Name_Id := N + 591; + Name_Divide : constant Name_Id := N + 591; + Name_Enclosing_Entity : constant Name_Id := N + 592; + Name_Exception_Information : constant Name_Id := N + 593; + Name_Exception_Message : constant Name_Id := N + 594; + Name_Exception_Name : constant Name_Id := N + 595; + Name_File : constant Name_Id := N + 596; + Name_Generic_Dispatching_Constructor : constant Name_Id := N + 597; + Name_Import_Address : constant Name_Id := N + 598; + Name_Import_Largest_Value : constant Name_Id := N + 599; + Name_Import_Value : constant Name_Id := N + 600; + Name_Is_Negative : constant Name_Id := N + 601; + Name_Line : constant Name_Id := N + 602; + Name_Rotate_Left : constant Name_Id := N + 603; + Name_Rotate_Right : constant Name_Id := N + 604; + Name_Shift_Left : constant Name_Id := N + 605; + Name_Shift_Right : constant Name_Id := N + 606; + Name_Shift_Right_Arithmetic : constant Name_Id := N + 607; + Name_Source_Location : constant Name_Id := N + 608; + Name_Unchecked_Conversion : constant Name_Id := N + 609; + Name_Unchecked_Deallocation : constant Name_Id := N + 610; + Name_To_Pointer : constant Name_Id := N + 611; + Last_Intrinsic_Name : constant Name_Id := N + 611; -- Names used in processing intrinsic calls - Name_Free : constant Name_Id := N + 610; + Name_Free : constant Name_Id := N + 612; -- Reserved words used only in Ada 95 - First_95_Reserved_Word : constant Name_Id := N + 611; - Name_Abstract : constant Name_Id := N + 611; - Name_Aliased : constant Name_Id := N + 612; - Name_Protected : constant Name_Id := N + 613; - Name_Until : constant Name_Id := N + 614; - Name_Requeue : constant Name_Id := N + 615; - Name_Tagged : constant Name_Id := N + 616; - Last_95_Reserved_Word : constant Name_Id := N + 616; + First_95_Reserved_Word : constant Name_Id := N + 613; + Name_Abstract : constant Name_Id := N + 613; + Name_Aliased : constant Name_Id := N + 614; + Name_Protected : constant Name_Id := N + 615; + Name_Until : constant Name_Id := N + 616; + Name_Requeue : constant Name_Id := N + 617; + Name_Tagged : constant Name_Id := N + 618; + Last_95_Reserved_Word : constant Name_Id := N + 618; subtype Ada_95_Reserved_Words is Name_Id range First_95_Reserved_Word .. Last_95_Reserved_Word; -- Miscellaneous names used in semantic checking - Name_Raise_Exception : constant Name_Id := N + 617; + Name_Raise_Exception : constant Name_Id := N + 619; -- Additional reserved words and identifiers used in GNAT Project Files -- Note that Name_External is already previously declared - Name_Ada_Roots : constant Name_Id := N + 618; - Name_Archive_Builder : constant Name_Id := N + 619; - Name_Archive_Indexer : constant Name_Id := N + 620; - Name_Archive_Suffix : constant Name_Id := N + 621; - Name_Binder : constant Name_Id := N + 622; - Name_Binder_Prefix : constant Name_Id := N + 623; - Name_Body_Suffix : constant Name_Id := N + 624; - Name_Builder : constant Name_Id := N + 625; - Name_Builder_Switches : constant Name_Id := N + 626; - Name_Compiler : constant Name_Id := N + 627; - Name_Compiler_Kind : constant Name_Id := N + 628; - Name_Config_Body_File_Name : constant Name_Id := N + 629; - Name_Config_Body_File_Name_Pattern : constant Name_Id := N + 630; - Name_Config_File_Switches : constant Name_Id := N + 631; - Name_Config_File_Unique : constant Name_Id := N + 632; - Name_Config_Spec_File_Name : constant Name_Id := N + 633; - Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + 634; - Name_Cross_Reference : constant Name_Id := N + 635; - Name_Default_Language : constant Name_Id := N + 636; - Name_Default_Switches : constant Name_Id := N + 637; - Name_Dependency_Driver : constant Name_Id := N + 638; - Name_Dependency_File_Kind : constant Name_Id := N + 639; - Name_Dependency_Switches : constant Name_Id := N + 640; - Name_Driver : constant Name_Id := N + 641; - Name_Excluded_Source_Dirs : constant Name_Id := N + 642; - Name_Excluded_Source_Files : constant Name_Id := N + 643; - Name_Exec_Dir : constant Name_Id := N + 644; - Name_Executable : constant Name_Id := N + 645; - Name_Executable_Suffix : constant Name_Id := N + 646; - Name_Extends : constant Name_Id := N + 647; - Name_Externally_Built : constant Name_Id := N + 648; - Name_Finder : constant Name_Id := N + 649; - Name_Global_Configuration_Pragmas : constant Name_Id := N + 650; - Name_Global_Config_File : constant Name_Id := N + 651; - Name_Gnatls : constant Name_Id := N + 652; - Name_Gnatstub : constant Name_Id := N + 653; - Name_Implementation : constant Name_Id := N + 654; - Name_Implementation_Exceptions : constant Name_Id := N + 655; - Name_Implementation_Suffix : constant Name_Id := N + 656; - Name_Include_Switches : constant Name_Id := N + 657; - Name_Include_Path : constant Name_Id := N + 658; - Name_Include_Path_File : constant Name_Id := N + 659; - Name_Language_Kind : constant Name_Id := N + 660; - Name_Language_Processing : constant Name_Id := N + 661; - Name_Languages : constant Name_Id := N + 662; - Name_Library_Ali_Dir : constant Name_Id := N + 663; - Name_Library_Auto_Init : constant Name_Id := N + 664; - Name_Library_Auto_Init_Supported : constant Name_Id := N + 665; - Name_Library_Builder : constant Name_Id := N + 666; - Name_Library_Dir : constant Name_Id := N + 667; - Name_Library_GCC : constant Name_Id := N + 668; - Name_Library_Interface : constant Name_Id := N + 669; - Name_Library_Kind : constant Name_Id := N + 670; - Name_Library_Name : constant Name_Id := N + 671; - Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + 672; - Name_Library_Options : constant Name_Id := N + 673; - Name_Library_Partial_Linker : constant Name_Id := N + 674; - Name_Library_Reference_Symbol_File : constant Name_Id := N + 675; - Name_Library_Src_Dir : constant Name_Id := N + 676; - Name_Library_Support : constant Name_Id := N + 677; - Name_Library_Symbol_File : constant Name_Id := N + 678; - Name_Library_Symbol_Policy : constant Name_Id := N + 679; - Name_Library_Version : constant Name_Id := N + 680; - Name_Library_Version_Switches : constant Name_Id := N + 681; - Name_Linker : constant Name_Id := N + 682; - Name_Linker_Executable_Option : constant Name_Id := N + 683; - Name_Linker_Lib_Dir_Option : constant Name_Id := N + 684; - Name_Linker_Lib_Name_Option : constant Name_Id := N + 685; - Name_Local_Config_File : constant Name_Id := N + 686; - Name_Local_Configuration_Pragmas : constant Name_Id := N + 687; - Name_Locally_Removed_Files : constant Name_Id := N + 688; - Name_Mapping_File_Switches : constant Name_Id := N + 689; - Name_Mapping_Spec_Suffix : constant Name_Id := N + 690; - Name_Mapping_Body_Suffix : constant Name_Id := N + 691; - Name_Metrics : constant Name_Id := N + 692; - Name_Naming : constant Name_Id := N + 693; - Name_Objects_Path : constant Name_Id := N + 694; - Name_Objects_Path_File : constant Name_Id := N + 695; - Name_Object_Dir : constant Name_Id := N + 696; - Name_Pic_Option : constant Name_Id := N + 697; - Name_Pretty_Printer : constant Name_Id := N + 698; - Name_Prefix : constant Name_Id := N + 699; - Name_Project : constant Name_Id := N + 700; - Name_Roots : constant Name_Id := N + 701; - Name_Required_Switches : constant Name_Id := N + 702; - Name_Run_Path_Option : constant Name_Id := N + 703; - Name_Runtime_Project : constant Name_Id := N + 704; - Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 705; - Name_Shared_Library_Prefix : constant Name_Id := N + 706; - Name_Shared_Library_Suffix : constant Name_Id := N + 707; - Name_Separate_Suffix : constant Name_Id := N + 708; - Name_Source_Dirs : constant Name_Id := N + 709; - Name_Source_Files : constant Name_Id := N + 710; - Name_Source_List_File : constant Name_Id := N + 711; - Name_Spec : constant Name_Id := N + 712; - Name_Spec_Suffix : constant Name_Id := N + 713; - Name_Specification : constant Name_Id := N + 714; - Name_Specification_Exceptions : constant Name_Id := N + 715; - Name_Specification_Suffix : constant Name_Id := N + 716; - Name_Stack : constant Name_Id := N + 717; - Name_Switches : constant Name_Id := N + 718; - Name_Symbolic_Link_Supported : constant Name_Id := N + 719; - Name_Toolchain_Description : constant Name_Id := N + 720; - Name_Toolchain_Version : constant Name_Id := N + 721; - Name_Runtime_Library_Dir : constant Name_Id := N + 722; + Name_Ada_Roots : constant Name_Id := N + 620; + Name_Archive_Builder : constant Name_Id := N + 621; + Name_Archive_Indexer : constant Name_Id := N + 622; + Name_Archive_Suffix : constant Name_Id := N + 623; + Name_Binder : constant Name_Id := N + 624; + Name_Binder_Prefix : constant Name_Id := N + 625; + Name_Body_Suffix : constant Name_Id := N + 626; + Name_Builder : constant Name_Id := N + 627; + Name_Builder_Switches : constant Name_Id := N + 628; + Name_Compiler : constant Name_Id := N + 629; + Name_Compiler_Kind : constant Name_Id := N + 630; + Name_Config_Body_File_Name : constant Name_Id := N + 631; + Name_Config_Body_File_Name_Pattern : constant Name_Id := N + 632; + Name_Config_File_Switches : constant Name_Id := N + 633; + Name_Config_File_Unique : constant Name_Id := N + 634; + Name_Config_Spec_File_Name : constant Name_Id := N + 635; + Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + 636; + Name_Cross_Reference : constant Name_Id := N + 637; + Name_Default_Language : constant Name_Id := N + 638; + Name_Default_Switches : constant Name_Id := N + 639; + Name_Dependency_Driver : constant Name_Id := N + 640; + Name_Dependency_File_Kind : constant Name_Id := N + 641; + Name_Dependency_Switches : constant Name_Id := N + 642; + Name_Driver : constant Name_Id := N + 643; + Name_Excluded_Source_Dirs : constant Name_Id := N + 644; + Name_Excluded_Source_Files : constant Name_Id := N + 645; + Name_Exec_Dir : constant Name_Id := N + 646; + Name_Executable : constant Name_Id := N + 647; + Name_Executable_Suffix : constant Name_Id := N + 648; + Name_Extends : constant Name_Id := N + 649; + Name_Externally_Built : constant Name_Id := N + 650; + Name_Finder : constant Name_Id := N + 651; + Name_Global_Configuration_Pragmas : constant Name_Id := N + 652; + Name_Global_Config_File : constant Name_Id := N + 653; + Name_Gnatls : constant Name_Id := N + 654; + Name_Gnatstub : constant Name_Id := N + 655; + Name_Implementation : constant Name_Id := N + 656; + Name_Implementation_Exceptions : constant Name_Id := N + 657; + Name_Implementation_Suffix : constant Name_Id := N + 658; + Name_Include_Switches : constant Name_Id := N + 659; + Name_Include_Path : constant Name_Id := N + 660; + Name_Include_Path_File : constant Name_Id := N + 661; + Name_Language_Kind : constant Name_Id := N + 662; + Name_Language_Processing : constant Name_Id := N + 663; + Name_Languages : constant Name_Id := N + 664; + Name_Library_Ali_Dir : constant Name_Id := N + 665; + Name_Library_Auto_Init : constant Name_Id := N + 666; + Name_Library_Auto_Init_Supported : constant Name_Id := N + 667; + Name_Library_Builder : constant Name_Id := N + 668; + Name_Library_Dir : constant Name_Id := N + 669; + Name_Library_GCC : constant Name_Id := N + 670; + Name_Library_Interface : constant Name_Id := N + 671; + Name_Library_Kind : constant Name_Id := N + 672; + Name_Library_Name : constant Name_Id := N + 673; + Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + 674; + Name_Library_Options : constant Name_Id := N + 675; + Name_Library_Partial_Linker : constant Name_Id := N + 676; + Name_Library_Reference_Symbol_File : constant Name_Id := N + 677; + Name_Library_Src_Dir : constant Name_Id := N + 678; + Name_Library_Support : constant Name_Id := N + 679; + Name_Library_Symbol_File : constant Name_Id := N + 680; + Name_Library_Symbol_Policy : constant Name_Id := N + 681; + Name_Library_Version : constant Name_Id := N + 682; + Name_Library_Version_Switches : constant Name_Id := N + 683; + Name_Linker : constant Name_Id := N + 684; + Name_Linker_Executable_Option : constant Name_Id := N + 685; + Name_Linker_Lib_Dir_Option : constant Name_Id := N + 686; + Name_Linker_Lib_Name_Option : constant Name_Id := N + 687; + Name_Local_Config_File : constant Name_Id := N + 688; + Name_Local_Configuration_Pragmas : constant Name_Id := N + 689; + Name_Locally_Removed_Files : constant Name_Id := N + 690; + Name_Mapping_File_Switches : constant Name_Id := N + 691; + Name_Mapping_Spec_Suffix : constant Name_Id := N + 692; + Name_Mapping_Body_Suffix : constant Name_Id := N + 693; + Name_Metrics : constant Name_Id := N + 694; + Name_Naming : constant Name_Id := N + 695; + Name_Objects_Path : constant Name_Id := N + 696; + Name_Objects_Path_File : constant Name_Id := N + 697; + Name_Object_Dir : constant Name_Id := N + 698; + Name_Pic_Option : constant Name_Id := N + 699; + Name_Pretty_Printer : constant Name_Id := N + 700; + Name_Prefix : constant Name_Id := N + 701; + Name_Project : constant Name_Id := N + 702; + Name_Roots : constant Name_Id := N + 703; + Name_Required_Switches : constant Name_Id := N + 704; + Name_Run_Path_Option : constant Name_Id := N + 705; + Name_Runtime_Project : constant Name_Id := N + 706; + Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 707; + Name_Shared_Library_Prefix : constant Name_Id := N + 708; + Name_Shared_Library_Suffix : constant Name_Id := N + 709; + Name_Separate_Suffix : constant Name_Id := N + 710; + Name_Source_Dirs : constant Name_Id := N + 711; + Name_Source_Files : constant Name_Id := N + 712; + Name_Source_List_File : constant Name_Id := N + 713; + Name_Spec : constant Name_Id := N + 714; + Name_Spec_Suffix : constant Name_Id := N + 715; + Name_Specification : constant Name_Id := N + 716; + Name_Specification_Exceptions : constant Name_Id := N + 717; + Name_Specification_Suffix : constant Name_Id := N + 718; + Name_Stack : constant Name_Id := N + 719; + Name_Switches : constant Name_Id := N + 720; + Name_Symbolic_Link_Supported : constant Name_Id := N + 721; + Name_Sync : constant Name_Id := N + 722; + Name_Synchronize : constant Name_Id := N + 723; + Name_Toolchain_Description : constant Name_Id := N + 724; + Name_Toolchain_Version : constant Name_Id := N + 725; + Name_Runtime_Library_Dir : constant Name_Id := N + 726; -- Other miscellaneous names used in front end - Name_Unaligned_Valid : constant Name_Id := N + 723; + Name_Unaligned_Valid : constant Name_Id := N + 727; -- Ada 2005 reserved words - First_2005_Reserved_Word : constant Name_Id := N + 724; - Name_Interface : constant Name_Id := N + 724; - Name_Overriding : constant Name_Id := N + 725; - Name_Synchronized : constant Name_Id := N + 726; - Last_2005_Reserved_Word : constant Name_Id := N + 726; + First_2005_Reserved_Word : constant Name_Id := N + 728; + Name_Interface : constant Name_Id := N + 728; + Name_Overriding : constant Name_Id := N + 729; + Name_Synchronized : constant Name_Id := N + 730; + Last_2005_Reserved_Word : constant Name_Id := N + 730; subtype Ada_2005_Reserved_Words is Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word; -- Mark last defined name for consistency check in Snames body - Last_Predefined_Name : constant Name_Id := N + 726; + Last_Predefined_Name : constant Name_Id := N + 730; --------------------------------------- -- Subtypes Defining Name Categories -- @@ -1206,6 +1210,7 @@ package Snames is Attribute_Modulus, Attribute_Null_Parameter, Attribute_Object_Size, + Attribute_Old, Attribute_Partition_ID, Attribute_Passed_By_Reference, Attribute_Pool_Address, @@ -1292,6 +1297,9 @@ package Snames is Attribute_Class, Attribute_Stub_Type); + type Attribute_Class_Array is array (Attribute_Id) of Boolean; + -- Type used to build attribute classification flag arrays + ------------------------------------ -- Convention Name ID Definitions -- ------------------------------------ @@ -1376,6 +1384,7 @@ package Snames is Pragma_No_Run_Time, Pragma_No_Strict_Aliasing, Pragma_Normalize_Scalars, + Pragma_Optimize_Alignment, Pragma_Polling, Pragma_Persistent_BSS, Pragma_Priority_Specific_Dispatching, @@ -1538,13 +1547,6 @@ package Snames is Task_Dispatching_FIFO_Within_Priorities); -- Id values used to identify task dispatching policies - ------------------ - -- Helper types -- - ------------------ - - type Attribute_Class_Array is array (Attribute_Id) of Boolean; - -- Type used to build attribute classification flag arrays - ----------------- -- Subprograms -- ----------------- diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h index e8c94b506ca..2f282edf4d1 100644 --- a/gcc/ada/snames.h +++ b/gcc/ada/snames.h @@ -111,79 +111,80 @@ extern unsigned char Get_Attribute_Id (int); #define Attr_Modulus 64 #define Attr_Null_Parameter 65 #define Attr_Object_Size 66 -#define Attr_Partition_ID 67 -#define Attr_Passed_By_Reference 68 -#define Attr_Pool_Address 69 -#define Attr_Pos 70 -#define Attr_Position 71 -#define Attr_Priority 72 -#define Attr_Range 73 -#define Attr_Range_Length 74 -#define Attr_Round 75 -#define Attr_Safe_Emax 76 -#define Attr_Safe_First 77 -#define Attr_Safe_Large 78 -#define Attr_Safe_Last 79 -#define Attr_Safe_Small 80 -#define Attr_Scale 81 -#define Attr_Scaling 82 -#define Attr_Signed_Zeros 83 -#define Attr_Size 84 -#define Attr_Small 85 -#define Attr_Storage_Size 86 -#define Attr_Storage_Unit 87 -#define Attr_Stream_Size 88 -#define Attr_Tag 89 -#define Attr_Target_Name 90 -#define Attr_Terminated 91 -#define Attr_To_Address 92 -#define Attr_Type_Class 93 -#define Attr_UET_Address 94 -#define Attr_Unbiased_Rounding 95 -#define Attr_Unchecked_Access 96 -#define Attr_Unconstrained_Array 97 -#define Attr_Universal_Literal_String 98 -#define Attr_Unrestricted_Access 99 -#define Attr_VADS_Size 100 -#define Attr_Val 101 -#define Attr_Valid 102 -#define Attr_Value_Size 103 -#define Attr_Version 104 -#define Attr_Wchar_T_Size 105 -#define Attr_Wide_Wide_Width 106 -#define Attr_Wide_Width 107 -#define Attr_Width 108 -#define Attr_Word_Size 109 -#define Attr_Adjacent 110 -#define Attr_Ceiling 111 -#define Attr_Copy_Sign 112 -#define Attr_Floor 113 -#define Attr_Fraction 114 -#define Attr_Image 115 -#define Attr_Input 116 -#define Attr_Machine 117 -#define Attr_Max 118 -#define Attr_Min 119 -#define Attr_Model 120 -#define Attr_Pred 121 -#define Attr_Remainder 122 -#define Attr_Rounding 123 -#define Attr_Succ 124 -#define Attr_Truncation 125 -#define Attr_Value 126 -#define Attr_Wide_Image 127 -#define Attr_Wide_Wide_Image 128 -#define Attr_Wide_Value 129 -#define Attr_Wide_Wide_Value 130 -#define Attr_Output 131 -#define Attr_Read 132 -#define Attr_Write 133 -#define Attr_Elab_Body 134 -#define Attr_Elab_Spec 135 -#define Attr_Storage_Pool 136 -#define Attr_Base 137 -#define Attr_Class 138 -#define Attr_Stub_Type 139 +#define Attr_Old 67 +#define Attr_Partition_ID 68 +#define Attr_Passed_By_Reference 69 +#define Attr_Pool_Address 70 +#define Attr_Pos 71 +#define Attr_Position 72 +#define Attr_Priority 73 +#define Attr_Range 74 +#define Attr_Range_Length 75 +#define Attr_Round 76 +#define Attr_Safe_Emax 77 +#define Attr_Safe_First 78 +#define Attr_Safe_Large 79 +#define Attr_Safe_Last 80 +#define Attr_Safe_Small 81 +#define Attr_Scale 82 +#define Attr_Scaling 83 +#define Attr_Signed_Zeros 84 +#define Attr_Size 85 +#define Attr_Small 86 +#define Attr_Storage_Size 87 +#define Attr_Storage_Unit 88 +#define Attr_Stream_Size 89 +#define Attr_Tag 90 +#define Attr_Target_Name 91 +#define Attr_Terminated 92 +#define Attr_To_Address 93 +#define Attr_Type_Class 94 +#define Attr_UET_Address 95 +#define Attr_Unbiased_Rounding 96 +#define Attr_Unchecked_Access 97 +#define Attr_Unconstrained_Array 98 +#define Attr_Universal_Literal_String 99 +#define Attr_Unrestricted_Access 100 +#define Attr_VADS_Size 101 +#define Attr_Val 102 +#define Attr_Valid 103 +#define Attr_Value_Size 104 +#define Attr_Version 105 +#define Attr_Wchar_T_Size 106 +#define Attr_Wide_Wide_Width 107 +#define Attr_Wide_Width 108 +#define Attr_Width 109 +#define Attr_Word_Size 110 +#define Attr_Adjacent 111 +#define Attr_Ceiling 112 +#define Attr_Copy_Sign 113 +#define Attr_Floor 114 +#define Attr_Fraction 115 +#define Attr_Image 116 +#define Attr_Input 117 +#define Attr_Machine 118 +#define Attr_Max 119 +#define Attr_Min 120 +#define Attr_Model 121 +#define Attr_Pred 122 +#define Attr_Remainder 123 +#define Attr_Rounding 124 +#define Attr_Succ 125 +#define Attr_Truncation 126 +#define Attr_Value 127 +#define Attr_Wide_Image 128 +#define Attr_Wide_Wide_Image 129 +#define Attr_Wide_Value 130 +#define Attr_Wide_Wide_Value 131 +#define Attr_Output 132 +#define Attr_Read 133 +#define Attr_Write 134 +#define Attr_Elab_Body 135 +#define Attr_Elab_Spec 136 +#define Attr_Storage_Pool 137 +#define Attr_Base 138 +#define Attr_Class 139 +#define Attr_Stub_Type 140 /* Define the numeric values for the conventions. */ @@ -247,138 +248,139 @@ extern unsigned char Get_Pragma_Id (int); #define Pragma_No_Run_Time 28 #define Pragma_No_Strict_Aliasing 29 #define Pragma_Normalize_Scalars 30 -#define Pragma_Polling 31 -#define Pragma_Persistent_BSS 32 -#define Pragma_Priority_Specific_Dispatching 33 -#define Pragma_Profile 34 -#define Pragma_Profile_Warnings 35 -#define Pragma_Propagate_Exceptions 36 -#define Pragma_Queuing_Policy 37 -#define Pragma_Ravenscar 38 -#define Pragma_Restricted_Run_Time 39 -#define Pragma_Restrictions 40 -#define Pragma_Restriction_Warnings 41 -#define Pragma_Reviewable 42 -#define Pragma_Source_File_Name 43 -#define Pragma_Source_File_Name_Project 44 -#define Pragma_Style_Checks 45 -#define Pragma_Suppress 46 -#define Pragma_Suppress_Exception_Locations 47 -#define Pragma_Task_Dispatching_Policy 48 -#define Pragma_Universal_Data 49 -#define Pragma_Unsuppress 50 -#define Pragma_Use_VADS_Size 51 -#define Pragma_Validity_Checks 52 -#define Pragma_Warnings 53 -#define Pragma_Wide_Character_Encoding 54 -#define Pragma_Abort_Defer 55 -#define Pragma_All_Calls_Remote 56 -#define Pragma_Annotate 57 -#define Pragma_Assert 58 -#define Pragma_Asynchronous 59 -#define Pragma_Atomic 60 -#define Pragma_Atomic_Components 61 -#define Pragma_Attach_Handler 62 -#define Pragma_CIL_Constructor 63 -#define Pragma_Comment 64 -#define Pragma_Common_Object 65 -#define Pragma_Complete_Representation 66 -#define Pragma_Complex_Representation 67 -#define Pragma_Controlled 68 -#define Pragma_Convention 69 -#define Pragma_CPP_Class 70 -#define Pragma_CPP_Constructor 71 -#define Pragma_CPP_Virtual 72 -#define Pragma_CPP_Vtable 73 -#define Pragma_Debug 74 -#define Pragma_Elaborate 75 -#define Pragma_Elaborate_All 76 -#define Pragma_Elaborate_Body 77 -#define Pragma_Export 78 -#define Pragma_Export_Exception 79 -#define Pragma_Export_Function 80 -#define Pragma_Export_Object 81 -#define Pragma_Export_Procedure 82 -#define Pragma_Export_Value 83 -#define Pragma_Export_Valued_Procedure 84 -#define Pragma_External 85 -#define Pragma_Finalize_Storage_Only 86 -#define Pragma_Ident 87 -#define Pragma_Implemented_By_Entry 88 -#define Pragma_Import 89 -#define Pragma_Import_Exception 90 -#define Pragma_Import_Function 91 -#define Pragma_Import_Object 92 -#define Pragma_Import_Procedure 93 -#define Pragma_Import_Valued_Procedure 94 -#define Pragma_Inline 95 -#define Pragma_Inline_Always 96 -#define Pragma_Inline_Generic 97 -#define Pragma_Inspection_Point 98 -#define Pragma_Interface_Name 99 -#define Pragma_Interrupt_Handler 100 -#define Pragma_Interrupt_Priority 101 -#define Pragma_Java_Constructor 102 -#define Pragma_Java_Interface 103 -#define Pragma_Keep_Names 104 -#define Pragma_Link_With 105 -#define Pragma_Linker_Alias 106 -#define Pragma_Linker_Constructor 107 -#define Pragma_Linker_Destructor 108 -#define Pragma_Linker_Options 109 -#define Pragma_Linker_Section 110 -#define Pragma_List 111 -#define Pragma_Machine_Attribute 112 -#define Pragma_Main 113 -#define Pragma_Main_Storage 114 -#define Pragma_Memory_Size 115 -#define Pragma_No_Body 116 -#define Pragma_No_Return 117 -#define Pragma_Obsolescent 118 -#define Pragma_Optimize 119 -#define Pragma_Pack 120 -#define Pragma_Page 121 -#define Pragma_Passive 122 -#define Pragma_Preelaborable_Initialization 123 -#define Pragma_Preelaborate 124 -#define Pragma_Preelaborate_05 125 -#define Pragma_Psect_Object 126 -#define Pragma_Pure 127 -#define Pragma_Pure_05 128 -#define Pragma_Pure_Function 129 -#define Pragma_Remote_Call_Interface 130 -#define Pragma_Remote_Types 131 -#define Pragma_Share_Generic 132 -#define Pragma_Shared 133 -#define Pragma_Shared_Passive 134 -#define Pragma_Source_Reference 135 -#define Pragma_Static_Elaboration_Desired 136 -#define Pragma_Stream_Convert 137 -#define Pragma_Subtitle 138 -#define Pragma_Suppress_All 139 -#define Pragma_Suppress_Debug_Info 140 -#define Pragma_Suppress_Initialization 141 -#define Pragma_System_Name 142 -#define Pragma_Task_Info 143 -#define Pragma_Task_Name 144 -#define Pragma_Task_Storage 145 -#define Pragma_Time_Slice 146 -#define Pragma_Title 147 -#define Pragma_Unchecked_Union 148 -#define Pragma_Unimplemented_Unit 149 -#define Pragma_Universal_Aliasing 150 -#define Pragma_Unmodified 151 -#define Pragma_Unreferenced 152 -#define Pragma_Unreferenced_Objects 153 -#define Pragma_Unreserve_All_Interrupts 154 -#define Pragma_Volatile 155 -#define Pragma_Volatile_Components 156 -#define Pragma_Weak_External 157 -#define Pragma_AST_Entry 158 -#define Pragma_Fast_Math 159 -#define Pragma_Interface 160 -#define Pragma_Priority 161 -#define Pragma_Storage_Size 162 -#define Pragma_Storage_Unit 163 +#define Pragma_Optimize_Alignment 31 +#define Pragma_Polling 32 +#define Pragma_Persistent_BSS 33 +#define Pragma_Priority_Specific_Dispatching 34 +#define Pragma_Profile 35 +#define Pragma_Profile_Warnings 36 +#define Pragma_Propagate_Exceptions 37 +#define Pragma_Queuing_Policy 38 +#define Pragma_Ravenscar 39 +#define Pragma_Restricted_Run_Time 40 +#define Pragma_Restrictions 41 +#define Pragma_Restriction_Warnings 42 +#define Pragma_Reviewable 43 +#define Pragma_Source_File_Name 44 +#define Pragma_Source_File_Name_Project 45 +#define Pragma_Style_Checks 46 +#define Pragma_Suppress 47 +#define Pragma_Suppress_Exception_Locations 48 +#define Pragma_Task_Dispatching_Policy 49 +#define Pragma_Universal_Data 50 +#define Pragma_Unsuppress 51 +#define Pragma_Use_VADS_Size 52 +#define Pragma_Validity_Checks 53 +#define Pragma_Warnings 54 +#define Pragma_Wide_Character_Encoding 55 +#define Pragma_Abort_Defer 56 +#define Pragma_All_Calls_Remote 57 +#define Pragma_Annotate 58 +#define Pragma_Assert 59 +#define Pragma_Asynchronous 60 +#define Pragma_Atomic 61 +#define Pragma_Atomic_Components 62 +#define Pragma_Attach_Handler 63 +#define Pragma_CIL_Constructor 64 +#define Pragma_Comment 65 +#define Pragma_Common_Object 66 +#define Pragma_Complete_Representation 67 +#define Pragma_Complex_Representation 68 +#define Pragma_Controlled 69 +#define Pragma_Convention 70 +#define Pragma_CPP_Class 71 +#define Pragma_CPP_Constructor 72 +#define Pragma_CPP_Virtual 73 +#define Pragma_CPP_Vtable 74 +#define Pragma_Debug 75 +#define Pragma_Elaborate 76 +#define Pragma_Elaborate_All 77 +#define Pragma_Elaborate_Body 78 +#define Pragma_Export 79 +#define Pragma_Export_Exception 80 +#define Pragma_Export_Function 81 +#define Pragma_Export_Object 82 +#define Pragma_Export_Procedure 83 +#define Pragma_Export_Value 84 +#define Pragma_Export_Valued_Procedure 85 +#define Pragma_External 86 +#define Pragma_Finalize_Storage_Only 87 +#define Pragma_Ident 88 +#define Pragma_Implemented_By_Entry 89 +#define Pragma_Import 90 +#define Pragma_Import_Exception 91 +#define Pragma_Import_Function 92 +#define Pragma_Import_Object 93 +#define Pragma_Import_Procedure 94 +#define Pragma_Import_Valued_Procedure 95 +#define Pragma_Inline 96 +#define Pragma_Inline_Always 97 +#define Pragma_Inline_Generic 98 +#define Pragma_Inspection_Point 99 +#define Pragma_Interface_Name 100 +#define Pragma_Interrupt_Handler 101 +#define Pragma_Interrupt_Priority 102 +#define Pragma_Java_Constructor 103 +#define Pragma_Java_Interface 104 +#define Pragma_Keep_Names 105 +#define Pragma_Link_With 106 +#define Pragma_Linker_Alias 107 +#define Pragma_Linker_Constructor 108 +#define Pragma_Linker_Destructor 109 +#define Pragma_Linker_Options 110 +#define Pragma_Linker_Section 111 +#define Pragma_List 112 +#define Pragma_Machine_Attribute 113 +#define Pragma_Main 114 +#define Pragma_Main_Storage 115 +#define Pragma_Memory_Size 116 +#define Pragma_No_Body 117 +#define Pragma_No_Return 118 +#define Pragma_Obsolescent 119 +#define Pragma_Optimize 120 +#define Pragma_Pack 121 +#define Pragma_Page 122 +#define Pragma_Passive 123 +#define Pragma_Preelaborable_Initialization 124 +#define Pragma_Preelaborate 125 +#define Pragma_Preelaborate_05 126 +#define Pragma_Psect_Object 127 +#define Pragma_Pure 128 +#define Pragma_Pure_05 129 +#define Pragma_Pure_Function 130 +#define Pragma_Remote_Call_Interface 131 +#define Pragma_Remote_Types 132 +#define Pragma_Share_Generic 133 +#define Pragma_Shared 134 +#define Pragma_Shared_Passive 135 +#define Pragma_Source_Reference 136 +#define Pragma_Static_Elaboration_Desired 137 +#define Pragma_Stream_Convert 138 +#define Pragma_Subtitle 139 +#define Pragma_Suppress_All 140 +#define Pragma_Suppress_Debug_Info 141 +#define Pragma_Suppress_Initialization 142 +#define Pragma_System_Name 143 +#define Pragma_Task_Info 144 +#define Pragma_Task_Name 145 +#define Pragma_Task_Storage 146 +#define Pragma_Time_Slice 147 +#define Pragma_Title 148 +#define Pragma_Unchecked_Union 149 +#define Pragma_Unimplemented_Unit 150 +#define Pragma_Universal_Aliasing 151 +#define Pragma_Unmodified 152 +#define Pragma_Unreferenced 153 +#define Pragma_Unreferenced_Objects 154 +#define Pragma_Unreserve_All_Interrupts 155 +#define Pragma_Volatile 156 +#define Pragma_Volatile_Components 157 +#define Pragma_Weak_External 158 +#define Pragma_AST_Entry 159 +#define Pragma_Fast_Math 160 +#define Pragma_Interface 161 +#define Pragma_Priority 162 +#define Pragma_Storage_Size 163 +#define Pragma_Storage_Unit 164 /* End of snames.h (C version of Snames package spec) */ diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index e37ba36446c..7db69e479f4 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2387,7 +2387,7 @@ package body Sprint is when N_Pragma => Write_Indent_Str_Sloc ("pragma "); - Write_Name_With_Col_Check (Chars (Node)); + Write_Name_With_Col_Check (Pragma_Name (Node)); if Present (Pragma_Argument_Associations (Node)) then Sprint_Opt_Paren_Comma_List diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads index 32b769fab38..964ff192d31 100644 --- a/gcc/ada/stand.ads +++ b/gcc/ada/stand.ads @@ -54,16 +54,11 @@ package Stand is S_Standard, S_ASCII, - -- Types defined in package Standard + -- Types and subtypes defined in package Standard (in the order in which + -- they appear in the RM, so that the declarations are in the right + -- order for the purposes of ASIS traversals S_Boolean, - S_Character, - S_Wide_Character, - S_Wide_Wide_Character, - S_String, - S_Wide_String, - S_Wide_Wide_String, - S_Duration, S_Short_Short_Integer, S_Short_Integer, @@ -71,21 +66,29 @@ package Stand is S_Long_Integer, S_Long_Long_Integer, + S_Natural, + S_Positive, + S_Short_Float, S_Float, S_Long_Float, S_Long_Long_Float, + S_Character, + S_Wide_Character, + S_Wide_Wide_Character, + + S_String, + S_Wide_String, + S_Wide_Wide_String, + + S_Duration, + -- Enumeration literals for type Boolean S_False, S_True, - -- Subtypes declared in package Standard - - S_Natural, - S_Positive, - -- Exceptions declared in package Standard S_Constraint_Error, @@ -218,7 +221,7 @@ package Stand is S_DEL); -- 16#7F# subtype S_Types is - Standard_Entity_Type range S_Boolean .. S_Long_Long_Float; + Standard_Entity_Type range S_Boolean .. S_Duration; subtype S_Exceptions is Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error; diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index ce9159bd675..b3ddd631946 100644 --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -360,7 +360,6 @@ package body Tbuild is begin return Make_Pragma (Sloc, - Chars => Chars, Pragma_Argument_Associations => Pragma_Argument_Associations, Debug_Statement => Debug_Statement, Pragma_Identifier => Make_Identifier (Sloc, Chars)); diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads index 886bb1cba6c..17be6272f7a 100644 --- a/gcc/ada/tbuild.ads +++ b/gcc/ada/tbuild.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 8bec7759bea..8bf93d2e711 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -687,10 +687,11 @@ Pragma_to_gnu (Node_Id gnat_node) /* Check for (and ignore) unrecognized pragma and do nothing if we are just annotating types. */ - if (type_annotate_only || !Is_Pragma_Name (Chars (gnat_node))) + if (type_annotate_only + || !Is_Pragma_Name (Chars (Pragma_Identifier (gnat_node)))) return gnu_result; - switch (Get_Pragma_Id (Chars (gnat_node))) + switch (Get_Pragma_Id (Pragma_Identifier (Chars (gnat_node)))) { case Pragma_Inspection_Point: /* Do nothing at top level: all such variables are already viewable. */ diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words index 270289bd5f8..3d8b83e0634 100644 --- a/gcc/ada/ug_words +++ b/gcc/ada/ug_words @@ -159,6 +159,8 @@ gcc -c ^ GNAT COMPILE -gnatwV ^ /WARNINGS=NOVARIABLES_UNINITIALIZED -gnatww ^ /WARNINGS=LOWBOUND_ASSUMED -gnatwW ^ /WARNINGS=NOLOWBOUND_ASSUMED +-gnatw.w ^ /WARNINGS=WARNINGS_OFF_PRAGMAS +-gnatw.W ^ /WARNINGS=NOWARNINGS_OFF_PRAGMAS -gnatwx ^ /WARNINGS=IMPORT_EXPORT_PRAGMAS -gnatwX ^ /WARNINGS=NOIMPORT_EXPORT_PRAGMAS -gnatw.x ^ /WARNINGS=LOCAL_RAISE_HANDLING diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 4ee886ebc9e..1f79670e44e 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -1280,6 +1280,8 @@ package body Uintp is Discard_Quotient : Boolean; Discard_Remainder : Boolean) is + pragma Warnings (Off, Quotient); + pragma Warnings (Off, Remainder); begin pragma Assert (Right /= Uint_0); diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 07735903f34..f64188e9b73 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -362,7 +362,7 @@ begin Write_Switch_Char ("wxx"); Write_Line ("Enable selected warning modes, xx = list of parameters:"); - Write_Line (" a turn on all optional warnings (except d h l .o)"); + Write_Line (" a turn on all optional warnings (except dhl.o.w)"); Write_Line (" A turn off all optional warnings"); Write_Line (" .a* turn on warnings for failing assertions"); Write_Line (" .A turn off warnings for failing assertions"); @@ -428,6 +428,8 @@ begin Write_Line (" w* turn on warnings for wrong low bound assumption"); Write_Line (" W turn off warnings for wrong low bound " & "assumption"); + Write_Line (" .w turn on warnings on pragma Warnings Off"); + Write_Line (" .w* turn off warnings on pragma Warnings Off"); Write_Line (" x* turn on warnings for export/import"); Write_Line (" X turn off warnings for export/import"); Write_Line (" .x turn on warnings for non-local exceptions"); diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb index efd3ab1bd79..128026134b6 100644 --- a/gcc/ada/vms_conv.adb +++ b/gcc/ada/vms_conv.adb @@ -397,6 +397,16 @@ package body VMS_Conv is Params => new Parameter_Array'(1 => Unlimited_Files), Defext => " "), + Sync => + (Cname => new S'("SYNC"), + Usage => new S'("GNAT SYNC name /qualifiers"), + VMS_Only => False, + Unixcmd => new S'("gnatsync"), + Unixsws => null, + Switches => Sync_Switches'Access, + Params => new Parameter_Array'(1 => Unlimited_Files), + Defext => " "), + Elim => (Cname => new S'("ELIM"), Usage => new S'("GNAT ELIM name /qualifiers"), diff --git a/gcc/ada/vms_conv.ads b/gcc/ada/vms_conv.ads index 179edc6e128..666cd3a2fad 100644 --- a/gcc/ada/vms_conv.ads +++ b/gcc/ada/vms_conv.ads @@ -98,6 +98,7 @@ package VMS_Conv is Clean, Compile, Check, + Sync, Elim, Find, Krunch, diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index dc2675b33c9..fa8e108e315 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1996-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -190,7 +190,7 @@ package VMS_Data is -- Switches for GNAT BIND -- ---------------------------- - S_Bind_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Bind_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -710,7 +710,7 @@ package VMS_Data is -- -- Add directories to the project search path. - S_Check_All : aliased constant S := "/ALL " & + S_Check_All : aliased constant S := "/ALL " & "-a"; -- /NOALL (D) -- /ALL @@ -719,7 +719,7 @@ package VMS_Data is -- components of the GNAT RTL when building and analyzing the global -- structure for checking the global rules. - S_Check_Ext : aliased constant S := "/EXTERNAL_REFERENCE=" & '"' & + S_Check_Ext : aliased constant S := "/EXTERNAL_REFERENCE=" & '"' & "-X" & '"'; -- /EXTERNAL_REFERENCE="name=val" -- @@ -729,33 +729,33 @@ package VMS_Data is -- Example: -- /EXTERNAL_REFERENCE="DEBUG=TRUE" - S_Check_Files : aliased constant S := "/FILES=@" & + S_Check_Files : aliased constant S := "/FILES=@" & "-files=@"; -- /FILES=filename -- -- Take as arguments the files that are listed in the specified -- text file. - S_Check_Help : aliased constant S := "/HELP " & + S_Check_Help : aliased constant S := "/HELP " & "-h"; -- /NOHELP (D) -- /HELP -- -- Print information about currently implemented checks. - S_Check_Locs : aliased constant S := "/LOCS " & + S_Check_Locs : aliased constant S := "/LOCS " & "-l"; -- /NOLOCS (D) -- /LOCS -- -- Use full source locations referebces in the report file. - S_Check_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & - "DEFAULT " & - "-vP0 " & - "MEDIUM " & - "-vP1 " & - "HIGH " & + S_Check_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & + "DEFAULT " & + "-vP0 " & + "MEDIUM " & + "-vP1 " & + "HIGH " & "-vP2"; -- /MESSAGES_PROJECT_FILE[=messages-option] -- @@ -769,7 +769,7 @@ package VMS_Data is -- HIGH A great number of messages are output, most of them not -- being useful for the user. - S_Check_Project : aliased constant S := "/PROJECT_FILE=<" & + S_Check_Project : aliased constant S := "/PROJECT_FILE=<" & "-P>"; -- /PROJECT_FILE=filename -- @@ -778,21 +778,21 @@ package VMS_Data is -- gnatcheck. The source directories to be searched will be communicated -- to gnatcheck through logical name ADA_PRJ_INCLUDE_FILE. - S_Check_Quiet : aliased constant S := "/QUIET " & + S_Check_Quiet : aliased constant S := "/QUIET " & "-q"; -- /NOQUIET (D) -- /QUIET -- -- Work quietly, only output warnings and errors. - S_Check_Sections : aliased constant S := "/SECTIONS=" & - "DEFAULT " & - "-s123 " & - "COMPILER_STYLE " & - "-s1 " & - "BY_RULES " & - "-s2 " & - "BY_FILES_BY_RULES " & + S_Check_Sections : aliased constant S := "/SECTIONS=" & + "DEFAULT " & + "-s123 " & + "COMPILER_STYLE " & + "-s1 " & + "BY_RULES " & + "-s2 " & + "BY_FILES_BY_RULES " & "-s3"; -- /SECTIONS[=section-option, section-option, ...] -- @@ -816,14 +816,14 @@ package VMS_Data is -- If one of these options is specified, then the report file contains -- only sections set by these options - S_Check_Short : aliased constant S := "/SHORT " & + S_Check_Short : aliased constant S := "/SHORT " & "-s"; -- /NOSHORT (D) -- /SHORT -- -- Generate a short form of the report file. - S_Check_Verb : aliased constant S := "/VERBOSE " & + S_Check_Verb : aliased constant S := "/VERBOSE " & "-v"; -- /NOVERBOSE (D) -- /VERBOSE @@ -847,6 +847,137 @@ package VMS_Data is S_Check_Verb 'Access); ---------------------------- + -- Switches for GNAT SYNC -- + ---------------------------- + + S_Sync_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + "-aP*"; + -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) + -- + -- Add directories to the project search path. + + S_Sync_All : aliased constant S := "/ALL " & + "-a"; + -- /NOALL (D) + -- /ALL + -- + -- Also check the components of the GNAT run time and process the needed + -- components of the GNAT RTL when building and analyzing the global + -- structure for checking the global rules. + + S_Sync_Ext : aliased constant S := "/EXTERNAL_REFERENCE=" & '"' & + "-X" & '"'; + -- /EXTERNAL_REFERENCE="name=val" + -- + -- Specifies an external reference to the project manager. Useful only if + -- /PROJECT_FILE is used. + -- + -- Example: + -- /EXTERNAL_REFERENCE="DEBUG=TRUE" + + S_Sync_Files : aliased constant S := "/FILES=@" & + "-files=@"; + -- /FILES=filename + -- + -- Take as arguments the files that are listed in the specified + -- text file. + + S_Sync_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & + "DEFAULT " & + "-vP0 " & + "MEDIUM " & + "-vP1 " & + "HIGH " & + "-vP2"; + -- /MESSAGES_PROJECT_FILE[=messages-option] + -- + -- Specifies the "verbosity" of the parsing of project files. + -- messages-option may be one of the following: + -- + -- DEFAULT (D) No messages are output if there is no error or warning. + -- + -- MEDIUM A small number of messages are output. + -- + -- HIGH A great number of messages are output, most of them not + -- being useful for the user. + + S_Sync_Project : aliased constant S := "/PROJECT_FILE=<" & + "-P>"; + -- /PROJECT_FILE=filename + -- + -- Specifies the main project file to be used. The project files rooted + -- at the main project file will be parsed before the invocation of the + -- gnatcheck. The source directories to be searched will be communicated + -- to gnatcheck through logical name ADA_PRJ_INCLUDE_FILE. + + S_Sync_Quiet : aliased constant S := "/QUIET " & + "-q"; + -- /NOQUIET (D) + -- /QUIET + -- + -- Work quietly, only output warnings and errors. + + S_Sync_Verb : aliased constant S := "/VERBOSE " & + "-v"; + -- /NOVERBOSE (D) + -- /VERBOSE + -- + -- The version number and copyright notice are output, as well as exact + -- copies of the gnat1 commands spawned to obtain the chop control + -- information. + + S_Sync_Exec : aliased constant S := "/EXECUTION_TIME " & + "-t"; + -- /NOEXECUTION_TIME (D) + -- /EXECUTION_TIME + -- + -- Output the execution time + + S_Sync_Details : aliased constant S := "/DETAILs=" & + "MEDIUM " & + "-om " & + "SHORT " & + "-os " & + "FULL " & + "-of"; + -- /DETAILS[=options] + -- + -- Specifies the details of the output. + -- Options may be one of the following: + -- + -- MEDIUM (D) + -- SHORT + -- FULL + + S_Sync_Warnoff : aliased constant S := "/WARNINGS_OFF " & + "-wq"; + -- + -- /WARNINGS_OFF + -- + -- Turn warnings off + + S_Sync_Output : aliased constant S := "/OUTPUT_FILE=<" & + "-out_file=>"; + -- + -- /OUTPUT_FILE=filename + -- + -- Redirect output to a text file + + Sync_Switches : aliased constant Switches := + (S_Sync_Add 'Access, + S_Sync_All 'Access, + S_Sync_Ext 'Access, + S_Sync_Files 'Access, + S_Sync_Mess 'Access, + S_Sync_Project 'Access, + S_Sync_Quiet 'Access, + S_Sync_Verb 'Access, + S_Sync_Exec 'Access, + S_Sync_Details 'Access, + S_Sync_Warnoff 'Access, + S_Sync_Output 'Access); + + ---------------------------- -- Switches for GNAT CHOP -- ---------------------------- @@ -1143,7 +1274,7 @@ package VMS_Data is -- Allows GNAT to recognize the full range of Ada 95 constructs. -- This is the normal default for GNAT Pro. - S_GCC_Ada_05 : aliased constant S := "/05 " & + S_GCC_Ada_05 : aliased constant S := "/05 " & "-gnat05"; -- /05 (D) -- @@ -1268,7 +1399,7 @@ package VMS_Data is -- -- Look for source files in the default directory. - S_GCC_Data : aliased constant S := "/DATA_PREPROCESSING=<" & + S_GCC_Data : aliased constant S := "/DATA_PREPROCESSING=<" & "-gnatep>"; -- /DATA_PREPROCESSING=file_name -- @@ -1652,7 +1783,7 @@ package VMS_Data is -- lines from the original source file, output as comment lines with the -- associated line number. - S_GCC_Just : aliased constant S := "/JUSTIFY_MESSAGES=#" & + S_GCC_Just : aliased constant S := "/JUSTIFY_MESSAGES=#" & "-gnatj#"; -- /NO_JUSTIFY_MESSAGES (D) @@ -1665,7 +1796,7 @@ package VMS_Data is -- behavior (each message counted separately and not reformatted to fit -- a particular line length) can be obtained using /NO_JUSTIFY_MESSAGES. - S_GCC_JustX : aliased constant S := "/NO_JUSTIFY_MESSAGES " & + S_GCC_JustX : aliased constant S := "/NO_JUSTIFY_MESSAGES " & "-gnatj0"; -- NODOC (see /JUSTIFY_MESSAGES) @@ -1686,7 +1817,7 @@ package VMS_Data is -- a body is compiled, the corresponding spec is also listed, along -- with any subunits. - S_GCC_Mapping : aliased constant S := "/MAPPING_FILE=<" & + S_GCC_Mapping : aliased constant S := "/MAPPING_FILE=<" & "-gnatem>"; -- /MAPPING_FILE=file_name -- @@ -1749,7 +1880,7 @@ package VMS_Data is -- HIGH A great number of messages are output, most of them not -- being useful for the user. - S_GCC_Nesting : aliased constant S := "/MAX_NESTING=#" & + S_GCC_Nesting : aliased constant S := "/MAX_NESTING=#" & "-gnatyL#"; -- /MAX_NESTING=nnn -- @@ -1796,7 +1927,7 @@ package VMS_Data is -- -- Do not look in the default directory for source files of the runtime. - S_GCC_Nostlib : aliased constant S := "/NOSTD_LIBRARIES " & + S_GCC_Nostlib : aliased constant S := "/NOSTD_LIBRARIES " & "-nostdlib"; -- /NOSTD_LIBRARIES -- @@ -2715,6 +2846,10 @@ package VMS_Data is "-gnatww " & "NOLOWBOUND_ASSUMED " & "-gnatwW " & + "WARNINGS_OFF_PRAGMAS " & + "-gnatw.w " & + "NO_WARNINGS_OFF_PRAGMAS " & + "-gnatw.W " & "IMPORT_EXPORT_PRAGMAS " & "-gnatwx " & "NOIMPORT_EXPORT_PRAGMAS " & @@ -3346,7 +3481,7 @@ package VMS_Data is -- Switches for GNAT FIND -- ---------------------------- - S_Find_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Find_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -3468,7 +3603,7 @@ package VMS_Data is -- -- This qualifier is not compatible with /PROJECT_FILE - S_Find_Prj : aliased constant S := "/PROJECT_FILE=<" & + S_Find_Prj : aliased constant S := "/PROJECT_FILE=<" & "-P>"; -- /PROJECT_FILE=filename -- @@ -3556,7 +3691,7 @@ package VMS_Data is -- Switches for GNAT LINK -- ---------------------------- - S_Link_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Link_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -3772,7 +3907,7 @@ package VMS_Data is -- Switches for GNAT LIST -- ---------------------------- - S_List_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_List_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -3973,7 +4108,7 @@ package VMS_Data is -- have been previously compiled and must be up to date, -- and the main program need to have been bound. - S_Make_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Make_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -4157,7 +4292,7 @@ package VMS_Data is -- are found on the Ada object path, the new object and ALI files are -- created in the directory containing the source being compiled. - S_Make_Index : aliased constant S := "/SOURCE_INDEX=#" & + S_Make_Index : aliased constant S := "/SOURCE_INDEX=#" & "-eI#"; -- /SOURCE_INDEX=nnn -- @@ -4472,7 +4607,7 @@ package VMS_Data is -- Switches for GNAT METRIC -- ------------------------------ - S_Metric_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Metric_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -4486,80 +4621,80 @@ package VMS_Data is -- specified, the underlying tool gnatmetric is called for all the -- sources of all the Project Files in the project tree. - S_Metric_Debug : aliased constant S := "/DEBUG_OUTPUT " & + S_Metric_Debug : aliased constant S := "/DEBUG_OUTPUT " & "-dv"; -- /DEBUG_OUTPUT -- -- Generate the debug information - S_Metric_Direct : aliased constant S := "/DIRECTORY=@" & + S_Metric_Direct : aliased constant S := "/DIRECTORY=@" & "-d=@"; -- /DIRECTORY=pathname -- -- Put the files with detailed metric information into the specified -- directory - S_Metric_Element : aliased constant S := "/ELEMENT_METRICS=" & - "ALL " & - "!-ed,!-es,!-enl,!-eps," & - "!-eas,!-ept,!-eat,!-enu," & - "!-ec " & - "DECLARATION_TOTAL " & - "-ed " & - "STATEMENT_TOTAL " & - "-es " & - "LOOP_NESTING_MAX " & - "-enl " & - "INT_SUBPROGRAMS " & - "-eps " & - "SUBPROGRAMS_ALL " & - "-eas " & - "INT_TYPES " & - "-ept " & - "TYPES_ALL " & - "-eat " & - "PROGRAM_NESTING_MAX " & - "-enu " & - "CONSTRUCT_NESTING_MAX " & + S_Metric_Element : aliased constant S := "/ELEMENT_METRICS=" & + "ALL " & + "!-ed,!-es,!-enl,!-eps," & + "!-eas,!-ept,!-eat,!-enu," & + "!-ec " & + "DECLARATION_TOTAL " & + "-ed " & + "STATEMENT_TOTAL " & + "-es " & + "LOOP_NESTING_MAX " & + "-enl " & + "INT_SUBPROGRAMS " & + "-eps " & + "SUBPROGRAMS_ALL " & + "-eas " & + "INT_TYPES " & + "-ept " & + "TYPES_ALL " & + "-eat " & + "PROGRAM_NESTING_MAX " & + "-enu " & + "CONSTRUCT_NESTING_MAX " & "-ec"; -- NODOC (see /SYNTAX_METRICS) - S_Metric_Syntax : aliased constant S := "/SYNTAX_METRICS=" & - "ALL_ON " & - "--syntax-all " & - "ALL_OFF " & - "--no-syntax-all " & - "DECLARATIONS_ON " & - "--declarations " & - "DECLARATIONS_OFF " & - "--no-declarations " & - "STATEMENTS_ON " & - "--statements " & - "STATEMENTS_OFF " & - "--no-statements " & - "PUBLIC_SUBPROGRAMS_ON " & - "--public-subprograms " & - "PUBLIC_SUBPROGRAMS_OFF " & - "--no-public-subprograms " & - "ALL_SUBPROGRAMS_ON " & - "--all-subprograms " & - "ALL_SUBPROGRAMS_OFF " & - "--no-all-subprograms " & - "PUBLIC_TYPES_ON " & - "--public-types " & - "PUBLIC_TYPES_OFF " & - "--no-public-types " & - "ALL_TYPES_ON " & - "--all-types " & - "ALL_TYPES_OFF " & - "--no-all-types " & - "UNIT_NESTING_ON " & - "--unit-nesting " & - "UNIT_NESTING_OFF " & - "--no-unit-nesting " & - "CONSTRUCT_NESTING_ON " & - "--construct-nesting " & - "CONSTRUCT_NESTING_OFF " & + S_Metric_Syntax : aliased constant S := "/SYNTAX_METRICS=" & + "ALL_ON " & + "--syntax-all " & + "ALL_OFF " & + "--no-syntax-all " & + "DECLARATIONS_ON " & + "--declarations " & + "DECLARATIONS_OFF " & + "--no-declarations " & + "STATEMENTS_ON " & + "--statements " & + "STATEMENTS_OFF " & + "--no-statements " & + "PUBLIC_SUBPROGRAMS_ON " & + "--public-subprograms " & + "PUBLIC_SUBPROGRAMS_OFF " & + "--no-public-subprograms " & + "ALL_SUBPROGRAMS_ON " & + "--all-subprograms " & + "ALL_SUBPROGRAMS_OFF " & + "--no-all-subprograms " & + "PUBLIC_TYPES_ON " & + "--public-types " & + "PUBLIC_TYPES_OFF " & + "--no-public-types " & + "ALL_TYPES_ON " & + "--all-types " & + "ALL_TYPES_OFF " & + "--no-all-types " & + "UNIT_NESTING_ON " & + "--unit-nesting " & + "UNIT_NESTING_OFF " & + "--no-unit-nesting " & + "CONSTRUCT_NESTING_ON " & + "--construct-nesting " & + "CONSTRUCT_NESTING_OFF " & "--no-construct-nesting"; -- /SYNTAX_METRICS(option, option ...) -- @@ -4598,7 +4733,7 @@ package VMS_Data is -- -- All combinations of syntax element metrics options are allowed. - S_Metric_Ext : aliased constant S := "/EXTERNAL_REFERENCE=" & '"' & + S_Metric_Ext : aliased constant S := "/EXTERNAL_REFERENCE=" & '"' & "-X" & '"'; -- /EXTERNAL_REFERENCE="name=val" -- @@ -4608,21 +4743,21 @@ package VMS_Data is -- Example: -- /EXTERNAL_REFERENCE="DEBUG=TRUE" - S_Metric_Files : aliased constant S := "/FILES=@" & + S_Metric_Files : aliased constant S := "/FILES=@" & "-files=@"; -- /FILES=filename -- -- Take as arguments the files that are listed in the specified -- text file. - S_Metric_Format : aliased constant S := "/FORMAT_OUTPUT=" & - "DEFAULT " & - "!-x,!-nt,!-sfn " & - "XML " & - "-x " & - "NO_TEXT " & - "-nt " & - "SHORT_SOURCE_FILE_NAME " & + S_Metric_Format : aliased constant S := "/FORMAT_OUTPUT=" & + "DEFAULT " & + "!-x,!-nt,!-sfn " & + "XML " & + "-x " & + "NO_TEXT " & + "-nt " & + "SHORT_SOURCE_FILE_NAME " & "-sfn"; -- /FORMAT_OUTPUT=(option, option ...) -- @@ -4636,64 +4771,64 @@ package VMS_Data is -- NO_TEXT Do not generate the text output (implies XML) -- SHORT_SOURCE_FILE_NAME Use short argument source names in output - S_Metric_Globout : aliased constant S := "/GLOBAL_OUTPUT=@" & + S_Metric_Globout : aliased constant S := "/GLOBAL_OUTPUT=@" & "-og@"; -- /GLOBAL_OUTPUT=filename -- -- Put the textual global metric information into the specified file - S_Metric_Line : aliased constant S := "/LINE_METRICS=" & - "ALL " & - "!-la,!-lcode,!-lcomm," & - "!-leol,!-lb " & - "LINES_ALL " & - "-la " & - "CODE_LINES " & - "-lcode " & - "COMENT_LINES " & - "-lcomm " & - "MIXED_CODE_COMMENTS " & - "-leol " & - "COMMENT_PERCENTAGE " & - "-lratio " & - "BLANK_LINES " & - "-lb " & - "AVERAGE_LINES_IN_BODIES " & + S_Metric_Line : aliased constant S := "/LINE_METRICS=" & + "ALL " & + "!-la,!-lcode,!-lcomm," & + "!-leol,!-lb " & + "LINES_ALL " & + "-la " & + "CODE_LINES " & + "-lcode " & + "COMENT_LINES " & + "-lcomm " & + "MIXED_CODE_COMMENTS " & + "-leol " & + "COMMENT_PERCENTAGE " & + "-lratio " & + "BLANK_LINES " & + "-lb " & + "AVERAGE_LINES_IN_BODIES " & "-lav "; -- NODOC (see /LINE_COUNT_METRICS) - S_Metric_Lines : aliased constant S := "/LINE_COUNT_METRICS=" & - "ALL_ON " & - "--lines-all " & - "ALL_OFF " & - "--no-lines-all " & - "ALL_LINES_ON " & - "--lines " & - "ALL_LINES_OFF " & - "--no-lines " & - "CODE_LINES_ON " & - "--lines-code " & - "CODE_LINES_OFF " & - "--no-lines-code " & - "COMMENT_LINES_ON " & - "--lines-comment " & - "COMMENT_LINES_OFF " & - "--no-lines-comment " & - "CODE_COMMENT_LINES_ON " & - "--lines-eol-comment " & - "CODE_COMMENT_LINES_OFF " & - "--no-lines-eol-comment " & - "COMMENT_PERCENTAGE_ON " & - "--lines-ratio " & - "COMMENT_PERCENTAGE_OFF " & - "--no-lines-ratio " & - "BLANK_LINES_ON " & - "--lines-blank " & - "BLANK_LINES_OFF " & - "--no-lines-blank " & - "AVERAGE_BODY_LINES_ON " & - "--lines-average " & - "AVERAGE_BODY_LINES_OFF " & + S_Metric_Lines : aliased constant S := "/LINE_COUNT_METRICS=" & + "ALL_ON " & + "--lines-all " & + "ALL_OFF " & + "--no-lines-all " & + "ALL_LINES_ON " & + "--lines " & + "ALL_LINES_OFF " & + "--no-lines " & + "CODE_LINES_ON " & + "--lines-code " & + "CODE_LINES_OFF " & + "--no-lines-code " & + "COMMENT_LINES_ON " & + "--lines-comment " & + "COMMENT_LINES_OFF " & + "--no-lines-comment " & + "CODE_COMMENT_LINES_ON " & + "--lines-eol-comment " & + "CODE_COMMENT_LINES_OFF " & + "--no-lines-eol-comment " & + "COMMENT_PERCENTAGE_ON " & + "--lines-ratio " & + "COMMENT_PERCENTAGE_OFF " & + "--no-lines-ratio " & + "BLANK_LINES_ON " & + "--lines-blank " & + "BLANK_LINES_OFF " & + "--no-lines-blank " & + "AVERAGE_BODY_LINES_ON " & + "--lines-average " & + "AVERAGE_BODY_LINES_OFF " & "--no-lines-average"; -- /LINE_COUNT_METRICS=(option, option ...) @@ -4729,26 +4864,26 @@ package VMS_Data is -- -- All combinations of line metrics options are allowed. - S_Metric_Complexity : aliased constant S := "/COMPLEXITY_METRICS=" & - "ALL_ON " & - "--complexity-all " & - "ALL_OFF " & - "--no-complexity-all " & - "CYCLOMATIC_ON " & - "--complexity-cyclomatic " & - "CYCLOMATIC_OFF " & - "--no-complexity-cyclomatic " & - "ESSENTIAL_ON " & - "--complexity-essential " & - "ESSENTIAL_OFF " & - "--no-complexity-essential " & - "LOOP_NESTING_ON " & - "--loop-nesting " & - "LOOP_NESTING_OFF " & - "--no-loop-nesting " & - "AVERAGE_COMPLEXITY_ON " & - "--complexity-average " & - "AVERAGE_COMPLEXITY_OFF " & + S_Metric_Complexity : aliased constant S := "/COMPLEXITY_METRICS=" & + "ALL_ON " & + "--complexity-all " & + "ALL_OFF " & + "--no-complexity-all " & + "CYCLOMATIC_ON " & + "--complexity-cyclomatic " & + "CYCLOMATIC_OFF " & + "--no-complexity-cyclomatic "& + "ESSENTIAL_ON " & + "--complexity-essential " & + "ESSENTIAL_OFF " & + "--no-complexity-essential " & + "LOOP_NESTING_ON " & + "--loop-nesting " & + "LOOP_NESTING_OFF " & + "--no-loop-nesting " & + "AVERAGE_COMPLEXITY_ON " & + "--complexity-average " & + "AVERAGE_COMPLEXITY_OFF " & "--no-complexity-average"; -- /COMPLEXITY_METRICS=(option, option ...) @@ -4790,12 +4925,12 @@ package VMS_Data is -- Do not count EXIT statements as GOTOs when computing the Essential -- Complexity. - S_Metric_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & - "DEFAULT " & - "-vP0 " & - "MEDIUM " & - "-vP1 " & - "HIGH " & + S_Metric_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" & + "DEFAULT " & + "-vP0 " & + "MEDIUM " & + "-vP1 " & + "HIGH " & "-vP2"; -- /MESSAGES_PROJECT_FILE[=messages-option] -- @@ -4809,7 +4944,7 @@ package VMS_Data is -- HIGH A great number of messages are output, most of them not -- being useful for the user. - S_Metric_Project : aliased constant S := "/PROJECT_FILE=<" & + S_Metric_Project : aliased constant S := "/PROJECT_FILE=<" & "-P>"; -- /PROJECT_FILE=filename -- @@ -4817,7 +4952,7 @@ package VMS_Data is -- at the main project file will be parsed before the invocation of the -- binder. - S_Metric_Quiet : aliased constant S := "/QUIET " & + S_Metric_Quiet : aliased constant S := "/QUIET " & "-q"; -- /NOQUIET (D) -- /QUIET @@ -4826,37 +4961,37 @@ package VMS_Data is -- the number of program units left to be processed. This option turns -- this trace off. - S_Metric_Suffix : aliased constant S := "/SUFFIX_DETAILS=" & '"' & + S_Metric_Suffix : aliased constant S := "/SUFFIX_DETAILS=" & '"' & "-o" & '"'; -- /SUFFIX_DETAILS=suffix -- -- Use the given suffix as the suffix for the name of the file to place -- the detailed metrics into. - S_Metric_Suppress : aliased constant S := "/SUPPRESS=" & - "NOTHING " & - "!-nocc,!-noec,!-nonl," & - "!-ne,!-nolocal " & - "CYCLOMATIC_COMPLEXITY " & - "-nocc " & - "ESSENTIAL_COMPLEXITY " & - "-noec " & - "MAXIMAL_LOOP_NESTING " & - "-nonl " & - "EXITS_AS_GOTOS " & - "-ne " & - "LOCAL_DETAILS " & + S_Metric_Suppress : aliased constant S := "/SUPPRESS=" & + "NOTHING " & + "!-nocc,!-noec,!-nonl," & + "!-ne,!-nolocal " & + "CYCLOMATIC_COMPLEXITY " & + "-nocc " & + "ESSENTIAL_COMPLEXITY " & + "-noec " & + "MAXIMAL_LOOP_NESTING " & + "-nonl " & + "EXITS_AS_GOTOS " & + "-ne " & + "LOCAL_DETAILS " & "-nolocal "; -- NODOC (see /COMPLEXITY_METRICS /NO_LOCAL_DETAILS /NO_EXITS_AS_GOTOS) - S_Metric_Verbose : aliased constant S := "/VERBOSE " & + S_Metric_Verbose : aliased constant S := "/VERBOSE " & "-v"; -- /NOVERBOSE (D) -- /VERBOSE -- -- Verbose mode. - S_Metric_XMLout : aliased constant S := "/XML_OUTPUT=@" & + S_Metric_XMLout : aliased constant S := "/XML_OUTPUT=@" & "-ox@"; -- /XML_OUTPUT=filename -- @@ -5079,7 +5214,7 @@ package VMS_Data is -- Switches for GNAT PRETTY -- ------------------------------ - S_Pretty_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Pretty_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -5120,7 +5255,7 @@ package VMS_Data is -- Specifying one of the ON options without first specifying the OFF -- option has no effect, because by default all alignments are set to ON. - S_Pretty_All_Prjs : aliased constant S := "/ALL_PROJECTS " & + S_Pretty_All_Prjs : aliased constant S := "/ALL_PROJECTS " & "-U"; -- /NOALL_PROJECTS (D) -- /ALL_PROJECTS @@ -5293,7 +5428,7 @@ package VMS_Data is -- Do not place the THEN keyword in IF statement and the LOOP keyword in -- for- and while-loops on a separate line. - S_Pretty_Use_On_New_Line : aliased constant S := "/USE_ON_NEW_LINE " & + S_Pretty_Use_On_New_Line : aliased constant S := "/USE_ON_NEW_LINE " & "--use-on-new-line"; -- /USE_ON_NEW_LINE -- @@ -5495,7 +5630,7 @@ package VMS_Data is -- -- MIXED_CASE Names are in mixed case. - S_Pretty_No_Backup : aliased constant S := "/NO_BACKUP " & + S_Pretty_No_Backup : aliased constant S := "/NO_BACKUP " & "-rnb"; -- /REPLACE_NO_BACKUP -- @@ -5739,7 +5874,7 @@ package VMS_Data is -- Switches for GNAT STACK -- ----------------------------- - S_Stack_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Stack_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -5925,7 +6060,7 @@ package VMS_Data is -- Switches for GNAT STUB -- ---------------------------- - S_Stub_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Stub_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- @@ -5983,6 +6118,14 @@ package VMS_Data is -- preceding the compilation unit) from the source of the -- library unit declaration into the body stub. + S_Stub_Header_File : aliased constant S := "/FROM_HEADER_FILE=<" & + "--header-file=>"; + + -- /FROM_HEADER_FILE==filename + -- + -- Use the content of the file as the comment header for a generated body + -- stub. + S_Stub_Indent : aliased constant S := "/INDENTATION=#" & "-i#"; -- /INDENTATION=nnn @@ -6099,28 +6242,29 @@ package VMS_Data is -- Verbose mode: generate version information. Stub_Switches : aliased constant Switches := - (S_Stub_Add 'Access, - S_Stub_Config 'Access, - S_Stub_Current 'Access, - S_Stub_Ext 'Access, - S_Stub_Full 'Access, - S_Stub_Header 'Access, - S_Stub_Indent 'Access, - S_Stub_Keep 'Access, - S_Stub_Length 'Access, - S_Stub_Mess 'Access, - S_Stub_Output 'Access, - S_Stub_Project 'Access, - S_Stub_Quiet 'Access, - S_Stub_Search 'Access, - S_Stub_Tree 'Access, - S_Stub_Verbose 'Access); + (S_Stub_Add 'Access, + S_Stub_Config 'Access, + S_Stub_Current 'Access, + S_Stub_Ext 'Access, + S_Stub_Full 'Access, + S_Stub_Header 'Access, + S_Stub_Header_File'Access, + S_Stub_Indent 'Access, + S_Stub_Keep 'Access, + S_Stub_Length 'Access, + S_Stub_Mess 'Access, + S_Stub_Output 'Access, + S_Stub_Project 'Access, + S_Stub_Quiet 'Access, + S_Stub_Search 'Access, + S_Stub_Tree 'Access, + S_Stub_Verbose 'Access); ---------------------------- -- Switches for GNAT XREF -- ---------------------------- - S_Xref_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & + S_Xref_Add : aliased constant S := "/ADD_PROJECT_SEARCH_DIR=*" & "-aP*"; -- /ADD_PROJECT_SEARCH_PATH==(directory[,...]) -- diff --git a/gcc/ada/xeinfo.adb b/gcc/ada/xeinfo.adb index 120bf397b22..b451d0b94b5 100644 --- a/gcc/ada/xeinfo.adb +++ b/gcc/ada/xeinfo.adb @@ -63,9 +63,6 @@ procedure XEinfo is Err : exception; - pragma Warnings (Off); - -- These seem not to be referenced, but they are (by * operator) - A : VString := Nul; B : VString := Nul; C : VString := Nul; @@ -88,8 +85,6 @@ procedure XEinfo is Rtn : VString := Nul; Term : VString := Nul; - pragma Warnings (On); - InB : File_Type; -- Used to read initial header from body diff --git a/gcc/ada/xnmake.adb b/gcc/ada/xnmake.adb index 3b3ed830b3a..2596d73b7c3 100644 --- a/gcc/ada/xnmake.adb +++ b/gcc/ada/xnmake.adb @@ -63,9 +63,6 @@ procedure XNmake is Err : exception; -- Raised to terminate execution - pragma Warnings (Off); - -- The following are modified by * operator - A : VString := Nul; Arg : VString := Nul; Arg_List : VString := Nul; diff --git a/gcc/ada/xsinfo.adb b/gcc/ada/xsinfo.adb index 3a1ba2e7e4a..786f4e39d45 100644 --- a/gcc/ada/xsinfo.adb +++ b/gcc/ada/xsinfo.adb @@ -55,9 +55,6 @@ procedure XSinfo is Done : exception; Err : exception; - pragma Warnings (Off); - -- Below variables are referenced using * operator - A : VString := Nul; Arg : VString := Nul; Comment : VString := Nul; @@ -68,10 +65,8 @@ procedure XSinfo is Rtn : VString := Nul; Term : VString := Nul; - pragma Warnings (On); - - InS : File_Type; - Ofile : File_Type; + InS : File_Type; + Ofile : File_Type; wsp : constant Pattern := Span (' ' & ASCII.HT); Wsp_For : constant Pattern := wsp & "for"; diff --git a/gcc/ada/xsnames.adb b/gcc/ada/xsnames.adb index 4e5ea56b93c..e5579d805e8 100644 --- a/gcc/ada/xsnames.adb +++ b/gcc/ada/xsnames.adb @@ -47,9 +47,6 @@ procedure XSnames is InH : File_Type; OutH : File_Type; - pragma Warnings (Off); - -- Variables below are modifed by * operator - A, B : VString := Nul; Line : VString := Nul; Name : VString := Nul; @@ -58,8 +55,6 @@ procedure XSnames is Oval : VString := Nul; Restl : VString := Nul; - pragma Warnings (On); - Tdigs : constant Pattern := Any (Decimal_Digit_Set) & Any (Decimal_Digit_Set) & Any (Decimal_Digit_Set); diff --git a/gcc/ada/xtreeprs.adb b/gcc/ada/xtreeprs.adb index 4d735298230..3078b53c6da 100644 --- a/gcc/ada/xtreeprs.adb +++ b/gcc/ada/xtreeprs.adb @@ -59,9 +59,6 @@ procedure XTreeprs is Err : exception; -- Raised on fatal error - pragma Warnings (Off); - -- Following variables are assigned by * operator - A : VString := Nul; Ffield : VString := Nul; Field : VString := Nul; @@ -78,8 +75,6 @@ procedure XTreeprs is Synonym : VString := Nul; Term : VString := Nul; - pragma Warnings (On); - subtype Sfile is Ada.Streams.Stream_IO.File_Type; OutS : Sfile; diff --git a/gcc/builtins.c b/gcc/builtins.c index 31b9df2d5dd..d07fed88614 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -2983,6 +2983,8 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) && (tree_expr_nonnegative_p (arg0) || !HONOR_NANS (mode))) { + REAL_VALUE_TYPE dconst3; + real_from_integer (&dconst3, VOIDmode, 3, 0, 0); real_arithmetic (&c2, MULT_EXPR, &c, &dconst3); real_round (&c2, mode, &c2); n = real_to_integer (&c2); @@ -7458,7 +7460,8 @@ fold_builtin_cabs (tree arg, tree type, tree fndecl) && operand_equal_p (real, imag, OEP_PURE_SAME)) { const REAL_VALUE_TYPE sqrt2_trunc - = real_value_truncate (TYPE_MODE (type), dconstsqrt2); + = real_value_truncate (TYPE_MODE (type), + *get_real_const (rv_sqrt2)); STRIP_NOPS (real); return fold_build2 (MULT_EXPR, type, fold_build1 (ABS_EXPR, type, real), @@ -7541,7 +7544,7 @@ fold_builtin_sqrt (tree arg, tree type) tree tree_root; /* The inner root was either sqrt or cbrt. */ REAL_VALUE_TYPE dconstroot = - BUILTIN_SQRT_P (fcode) ? dconsthalf : dconstthird; + BUILTIN_SQRT_P (fcode) ? dconsthalf : *get_real_const (rv_third); /* Adjust for the outer root. */ SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); @@ -7594,7 +7597,7 @@ fold_builtin_cbrt (tree arg, tree type) { tree expfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0); const REAL_VALUE_TYPE third_trunc = - real_value_truncate (TYPE_MODE (type), dconstthird); + real_value_truncate (TYPE_MODE (type), *get_real_const (rv_third)); arg = fold_build2 (MULT_EXPR, type, CALL_EXPR_ARG (arg, 0), build_real (type, third_trunc)); @@ -7610,7 +7613,7 @@ fold_builtin_cbrt (tree arg, tree type) { tree arg0 = CALL_EXPR_ARG (arg, 0); tree tree_root; - REAL_VALUE_TYPE dconstroot = dconstthird; + REAL_VALUE_TYPE dconstroot = *get_real_const (rv_third); SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); @@ -7632,7 +7635,9 @@ fold_builtin_cbrt (tree arg, tree type) tree tree_root; REAL_VALUE_TYPE dconstroot; - real_arithmetic (&dconstroot, MULT_EXPR, &dconstthird, &dconstthird); + real_arithmetic (&dconstroot, MULT_EXPR, + get_real_const (rv_third), + get_real_const (rv_third)); dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); tree_root = build_real (type, dconstroot); return build_call_expr (powfn, 2, arg0, tree_root); @@ -7651,7 +7656,8 @@ fold_builtin_cbrt (tree arg, tree type) { tree powfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0); const REAL_VALUE_TYPE dconstroot - = real_value_truncate (TYPE_MODE (type), dconstthird); + = real_value_truncate (TYPE_MODE (type), + *get_real_const (rv_third)); tree narg01 = fold_build2 (MULT_EXPR, type, arg01, build_real (type, dconstroot)); return build_call_expr (powfn, 2, arg00, narg01); @@ -8199,7 +8205,7 @@ fold_builtin_logarithm (tree fndecl, tree arg, if (flag_unsafe_math_optimizations && func == mpfr_log) { const REAL_VALUE_TYPE e_truncated = - real_value_truncate (TYPE_MODE (type), dconste); + real_value_truncate (TYPE_MODE (type), *get_real_const (rv_e)); if (real_dconstp (arg, &e_truncated)) return build_real (type, dconst1); } @@ -8233,7 +8239,8 @@ fold_builtin_logarithm (tree fndecl, tree arg, CASE_FLT_FN (BUILT_IN_EXP): /* Prepare to do logN(exp(exponent) -> exponent*logN(e). */ x = build_real (type, - real_value_truncate (TYPE_MODE (type), dconste)); + real_value_truncate (TYPE_MODE (type), + *get_real_const (rv_e))); exponent = CALL_EXPR_ARG (arg, 0); break; CASE_FLT_FN (BUILT_IN_EXP2): @@ -8244,7 +8251,11 @@ fold_builtin_logarithm (tree fndecl, tree arg, CASE_FLT_FN (BUILT_IN_EXP10): CASE_FLT_FN (BUILT_IN_POW10): /* Prepare to do logN(exp10(exponent) -> exponent*logN(10). */ - x = build_real (type, dconst10); + { + REAL_VALUE_TYPE dconst10; + real_from_integer (&dconst10, VOIDmode, 10, 0, 0); + x = build_real (type, dconst10); + } exponent = CALL_EXPR_ARG (arg, 0); break; CASE_FLT_FN (BUILT_IN_SQRT): @@ -8256,7 +8267,7 @@ fold_builtin_logarithm (tree fndecl, tree arg, /* Prepare to do logN(cbrt(x) -> (1/3)*logN(x). */ x = CALL_EXPR_ARG (arg, 0); exponent = build_real (type, real_value_truncate (TYPE_MODE (type), - dconstthird)); + *get_real_const (rv_third))); break; CASE_FLT_FN (BUILT_IN_POW): /* Prepare to do logN(pow(x,exponent) -> exponent*logN(x). */ @@ -8316,7 +8327,7 @@ fold_builtin_hypot (tree fndecl, tree arg0, tree arg1, tree type) && operand_equal_p (arg0, arg1, OEP_PURE_SAME)) { const REAL_VALUE_TYPE sqrt2_trunc - = real_value_truncate (TYPE_MODE (type), dconstsqrt2); + = real_value_truncate (TYPE_MODE (type), *get_real_const (rv_sqrt2)); return fold_build2 (MULT_EXPR, type, fold_build1 (ABS_EXPR, type, arg0), build_real (type, sqrt2_trunc)); @@ -8382,7 +8393,8 @@ fold_builtin_pow (tree fndecl, tree arg0, tree arg1, tree type) if (flag_unsafe_math_optimizations) { const REAL_VALUE_TYPE dconstroot - = real_value_truncate (TYPE_MODE (type), dconstthird); + = real_value_truncate (TYPE_MODE (type), + *get_real_const (rv_third)); if (REAL_VALUES_EQUAL (c, dconstroot)) { @@ -8449,7 +8461,8 @@ fold_builtin_pow (tree fndecl, tree arg0, tree arg1, tree type) if (tree_expr_nonnegative_p (arg)) { const REAL_VALUE_TYPE dconstroot - = real_value_truncate (TYPE_MODE (type), dconstthird); + = real_value_truncate (TYPE_MODE (type), + *get_real_const (rv_third)); tree narg1 = fold_build2 (MULT_EXPR, type, arg1, build_real (type, dconstroot)); return build_call_expr (fndecl, 2, arg, narg1); diff --git a/gcc/c-common.c b/gcc/c-common.c index 2bc74348e6a..1b629745239 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3347,6 +3347,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain) { if (complain && (pedantic || warn_pointer_arith)) pedwarn ("invalid application of %<sizeof%> to a function type"); + else if (!complain) + return error_mark_node; value = size_one_node; } else @@ -3357,6 +3359,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain) if (type_code == VOID_TYPE && complain && (pedantic || warn_pointer_arith)) pedwarn ("invalid application of %qs to a void type", op_name); + else if (!complain) + return error_mark_node; value = size_one_node; } else if (!COMPLETE_TYPE_P (type)) diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index 96e4e49a73d..156ad976ce2 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -24,7 +24,5 @@ $(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/gentune.sh \ $(srcdir)/config/arm/arm-cores.def > \ $(srcdir)/config/arm/arm-tune.md -arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/arm-c.c - +arm-c.o: $(srcdir)/config/arm/arm-c.c + $(COMPILE) $< diff --git a/gcc/config/arm/t-pe b/gcc/config/arm/t-pe index 741e2b85ab7..f2a7d68383d 100644 --- a/gcc/config/arm/t-pe +++ b/gcc/config/arm/t-pe @@ -20,9 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c +pe.o: $(srcdir)/config/arm/pe.c + $(COMPILE) $< MULTILIB_OPTIONS = mhard-float mthumb MULTILIB_DIRNAMES = fpu thumb diff --git a/gcc/config/arm/t-strongarm-pe b/gcc/config/arm/t-strongarm-pe index 2e4732fb26f..4058850635c 100644 --- a/gcc/config/arm/t-strongarm-pe +++ b/gcc/config/arm/t-strongarm-pe @@ -20,9 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c +pe.o: $(srcdir)/config/arm/pe.c + $(COMPILE) $< MULTILIB_OPTIONS = mhard-float/msoft-float MULTILIB_DIRNAMES = fpu soft diff --git a/gcc/config/arm/t-wince-pe b/gcc/config/arm/t-wince-pe index fca9853e75c..232685351f8 100644 --- a/gcc/config/arm/t-wince-pe +++ b/gcc/config/arm/t-wince-pe @@ -20,9 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c +pe.o: $(srcdir)/config/arm/pe.c + $(COMPILE) $< MULTILIB_OPTIONS = mhard-float MULTILIB_DIRNAMES = fpu diff --git a/gcc/config/bfin/t-bfin-linux b/gcc/config/bfin/t-bfin-linux index f79ccacfbab..849dceed483 100644 --- a/gcc/config/bfin/t-bfin-linux +++ b/gcc/config/bfin/t-bfin-linux @@ -33,3 +33,5 @@ linux-sysroot-suffix.h: $(srcdir)/config/bfin/print-sysroot-suffix.sh $(SHELL) $(srcdir)/config/bfin/print-sysroot-suffix.sh \ "$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \ "$(MULTILIB_OPTIONS)" > $@ + +generated_files += linux-sysroot-suffix.h diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index 3b18af5ba0f..da6f61980e2 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -327,10 +327,6 @@ do { \ #undef MS_AGGREGATE_RETURN #define MS_AGGREGATE_RETURN 1 -/* No data type wants to be aligned rounder than this. */ -#undef BIGGEST_ALIGNMENT -#define BIGGEST_ALIGNMENT 128 - /* Biggest alignment supported by the object file format of this machine. Use this macro to limit the alignment which can be specified using the `__attribute__ ((aligned (N)))' construct. If diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8ddfa9f183b..3dfb301962c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4599,8 +4599,8 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type) align = PARM_BOUNDARY; } } - if (align > 128) - align = 128; + if (align > BIGGEST_ALIGNMENT) + align = BIGGEST_ALIGNMENT; return align; } @@ -4997,8 +4997,8 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) We also may end up assuming that only 64bit values are stored in SSE register let some floating point program work. */ - if (ix86_preferred_stack_boundary >= 128) - cfun->stack_alignment_needed = 128; + if (ix86_preferred_stack_boundary >= BIGGEST_ALIGNMENT) + cfun->stack_alignment_needed = BIGGEST_ALIGNMENT; save_area = frame_pointer_rtx; set = get_varargs_alias_set (); @@ -24311,7 +24311,7 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, enum machine_mode mode, e2 = gen_reg_rtx (mode); e3 = gen_reg_rtx (mode); - real_arithmetic (&r, NEGATE_EXPR, &dconst3, NULL); + real_from_integer (&r, VOIDmode, -3, -1, 0); mthree = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode); real_arithmetic (&r, NEGATE_EXPR, &dconsthalf, NULL); diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming index b2c50df01fa..0a0315e4ea9 100644 --- a/gcc/config/i386/t-cygming +++ b/gcc/config/i386/t-cygming @@ -10,29 +10,16 @@ LIMITS_H_TEST = true # first. LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include -winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ - $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/winnt.c +winnt.o: $(srcdir)/config/i386/winnt.c + $(COMPILE) $< -winnt-cxx.o: $(srcdir)/config/i386/winnt-cxx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ - $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/winnt-cxx.c +winnt-cxx.o: $(srcdir)/config/i386/winnt-cxx.c + $(COMPILE) $< +winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c + $(COMPILE) $< -winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ - $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/winnt-stubs.c - -msformat-c.o: $(srcdir)/config/i386/msformat-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ - $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/msformat-c.c +msformat-c.o: $(srcdir)/config/i386/msformat-c.c + $(COMPILE) $< STMP_FIXINC=stmp-fixinc diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin index c6e77731b1a..b8a22d84fae 100644 --- a/gcc/config/i386/t-cygwin +++ b/gcc/config/i386/t-cygwin @@ -4,13 +4,8 @@ LIBGCC2_INCLUDES += -I$(srcdir)/../winsup/include \ -I$(srcdir)/../winsup/cygwin/include -cygwin1.o: $(srcdir)/config/i386/cygwin1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/cygwin1.c - -cygwin2.o: $(srcdir)/config/i386/cygwin2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/cygwin2.c +cygwin1.o: $(srcdir)/config/i386/cygwin1.c + $(COMPILE) $< +cygwin2.o: $(srcdir)/config/i386/cygwin2.c + $(COMPILE) $< diff --git a/gcc/config/i386/t-interix b/gcc/config/i386/t-interix index d5fff6167b7..b62394005ae 100644 --- a/gcc/config/i386/t-interix +++ b/gcc/config/i386/t-interix @@ -1,7 +1,5 @@ LIB1ASMSRC = i386/cygwin.asm LIB1ASMFUNCS = _chkstk -winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ - $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c +winnt.o: $(srcdir)/config/i386/winnt.c + $(COMPILE) $< diff --git a/gcc/config/i386/t-netware b/gcc/config/i386/t-netware index 2d3a828a5e5..6e35a431e5e 100644 --- a/gcc/config/i386/t-netware +++ b/gcc/config/i386/t-netware @@ -1,7 +1,7 @@ TARGET_LIBGCC2_CFLAGS = -mpreferred-stack-boundary=2 -fomit-frame-pointer -netware.o: $(srcdir)/config/i386/netware.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/netware.c +netware.o: $(srcdir)/config/i386/netware.c + $(COMPILE) $< # We don't need some of GCC's own include files. USER_H = $(srcdir)/ginclude/stdarg.h \ diff --git a/gcc/config/i386/t-nwld b/gcc/config/i386/t-nwld index db5b905b7e3..a8894894ece 100644 --- a/gcc/config/i386/t-nwld +++ b/gcc/config/i386/t-nwld @@ -20,8 +20,8 @@ $(T)posixpre.def: $(srcdir)/config/i386/t-nwld echo "exit POSIX_Stop" >>$@ echo "check POSIX_CheckUnload" >>$@ -nwld.o: $(srcdir)/config/i386/nwld.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/nwld.c +nwld.o: $(srcdir)/config/i386/nwld.c + $(COMPILE) $< s-crt0: $(srcdir)/unwind-dw2-fde.h diff --git a/gcc/config/i386/x-cygwin b/gcc/config/i386/x-cygwin index cfd7758cfb3..0fc84de4f75 100644 --- a/gcc/config/i386/x-cygwin +++ b/gcc/config/i386/x-cygwin @@ -1,4 +1,3 @@ -host-cygwin.o : $(srcdir)/config/i386/host-cygwin.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h diagnostic.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/host-cygwin.c +host-cygwin.o : $(srcdir)/config/i386/host-cygwin.c + $(COMPILE) $< + diff --git a/gcc/config/i386/x-darwin b/gcc/config/i386/x-darwin index 9a3b0f262ce..be8f8130e66 100644 --- a/gcc/config/i386/x-darwin +++ b/gcc/config/i386/x-darwin @@ -1,4 +1,2 @@ -host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) \ - config/host-darwin.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c + $(COMPILE) $< diff --git a/gcc/config/i386/x-i386 b/gcc/config/i386/x-i386 index 9f03de4535e..3fbe84f7ecc 100644 --- a/gcc/config/i386/x-i386 +++ b/gcc/config/i386/x-i386 @@ -1,4 +1,2 @@ -driver-i386.o : $(srcdir)/config/i386/driver-i386.c \ - $(srcdir)/config/i386/cpuid.h \ - $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +driver-i386.o : $(srcdir)/config/i386/driver-i386.c + $(COMPILE) $< diff --git a/gcc/config/i386/x-mingw32 b/gcc/config/i386/x-mingw32 index 7ae61522a56..1d9d11f9f50 100644 --- a/gcc/config/i386/x-mingw32 +++ b/gcc/config/i386/x-mingw32 @@ -7,7 +7,5 @@ local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's| # code does not handle that, so we have to disable checking here. WERROR_FLAGS += -Wno-format -host-mingw32.o : $(srcdir)/config/i386/host-mingw32.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/i386/host-mingw32.c +host-mingw32.o : $(srcdir)/config/i386/host-mingw32.c + $(COMPILE) $< diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64 index 10a5cf38377..d8bb0b443b4 100644 --- a/gcc/config/ia64/t-ia64 +++ b/gcc/config/ia64/t-ia64 @@ -26,9 +26,8 @@ T = disable LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \ $(srcdir)/unwind-c.c -ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/ia64/ia64-c.c +ia64-c.o: $(srcdir)/config/ia64/ia64-c.c + $(COMPILE) $< # genattrtab generates very long string literals. insn-attrtab.o-warn = -Wno-error diff --git a/gcc/config/m32c/t-m32c b/gcc/config/m32c/t-m32c index de2a54f344a..5d5f2c13356 100644 --- a/gcc/config/m32c/t-m32c +++ b/gcc/config/m32c/t-m32c @@ -56,8 +56,8 @@ md : $(MD_FILES:%=$(srcdir)/config/m32c/%.md) $(srcdir)/config/m32c/t-m32c echo "(include \"$(srcdir)/config/m32c/$$md.md\")"; \ done > md -m32c-pragma.o: $(srcdir)/config/m32c/m32c-pragma.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +m32c-pragma.o: $(srcdir)/config/m32c/m32c-pragma.c + $(COMPILE) $< # We support four CPU series, but R8C and M16C share one multilib, and # M32C and M32CM share another. diff --git a/gcc/config/m68k/t-uclinux b/gcc/config/m68k/t-uclinux index 3ee359d790f..f8606723303 100644 --- a/gcc/config/m68k/t-uclinux +++ b/gcc/config/m68k/t-uclinux @@ -14,3 +14,5 @@ sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh $(SHELL) $(srcdir)/config/m68k/print-sysroot-suffix.sh \ "$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \ "$(MULTILIB_OPTIONS)" > $@ + +generated_files += sysroot-suffix.h diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 08537117628..d0830bba7e0 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -2421,6 +2421,8 @@ rs6000_builtin_type_compatible (tree t, int id) { tree builtin_type; builtin_type = rs6000_builtin_type (id); + if (t == error_mark_node) + return false; if (INTEGRAL_TYPE_P (t) && INTEGRAL_TYPE_P (builtin_type)) return true; else diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000 index caa07153ad3..161f4d18dd6 100644 --- a/gcc/config/rs6000/t-rs6000 +++ b/gcc/config/rs6000/t-rs6000 @@ -2,19 +2,8 @@ gt-rs6000.h: s-gtype ; @true -rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h \ - real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \ - $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \ - output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \ - $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h \ - cfglayout.h - -rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \ - $(srcdir)/config/rs6000/rs6000-protos.h \ - $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \ - $(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/rs6000/rs6000-c.c +rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c + $(COMPILE) $< # The rs6000 backend doesn't cause warnings in these files. insn-conditions.o-warn = diff --git a/gcc/config/rs6000/x-darwin b/gcc/config/rs6000/x-darwin index 033ab6bf54c..ac1f2fc4654 100644 --- a/gcc/config/rs6000/x-darwin +++ b/gcc/config/rs6000/x-darwin @@ -1,4 +1,2 @@ -host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \ - config/host-darwin.h $(DIAGNOSTIC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ +host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c + $(COMPILE) $< diff --git a/gcc/config/rs6000/x-darwin64 b/gcc/config/rs6000/x-darwin64 index 3cb423db35e..4b13bbbe236 100644 --- a/gcc/config/rs6000/x-darwin64 +++ b/gcc/config/rs6000/x-darwin64 @@ -1,4 +1,2 @@ -host-ppc64-darwin.o : $(srcdir)/config/rs6000/host-ppc64-darwin.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \ - config/host-darwin.h $(DIAGNOSTIC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ +host-ppc64-darwin.o : $(srcdir)/config/rs6000/host-ppc64-darwin.c + $(COMPILE) $< diff --git a/gcc/config/rs6000/x-rs6000 b/gcc/config/rs6000/x-rs6000 index 8246c377630..8190b3426e6 100644 --- a/gcc/config/rs6000/x-rs6000 +++ b/gcc/config/rs6000/x-rs6000 @@ -1,3 +1,2 @@ -driver-rs6000.o : $(srcdir)/config/rs6000/driver-rs6000.c \ - $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +driver-rs6000.o : $(srcdir)/config/rs6000/driver-rs6000.c + $(COMPILE) $< diff --git a/gcc/config/score/t-score-elf b/gcc/config/score/t-score-elf index f27484fea46..ed18d2938c9 100644 --- a/gcc/config/score/t-score-elf +++ b/gcc/config/score/t-score-elf @@ -1,15 +1,9 @@ # Additional Backend Files -score7.o: $(srcdir)/config/score/score7.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(RTL_H) output.h flags.h $(TREE_H) \ - expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/score/score7.c - -score3.o: $(srcdir)/config/score/score3.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(RTL_H) output.h flags.h $(TREE_H) \ - expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/score/score3.c +score7.o: $(srcdir)/config/score/score7.c + $(COMPILE) $< + +score3.o: $(srcdir)/config/score/score3.c + $(COMPILE) $< # Assemble startup files. diff --git a/gcc/config/sh/constraints.md b/gcc/config/sh/constraints.md index 333c5beccb9..5844793e59e 100644 --- a/gcc/config/sh/constraints.md +++ b/gcc/config/sh/constraints.md @@ -35,6 +35,8 @@ ;; M: 1 ;; N: 0 ;; P27: 1 | 2 | 8 | 16 +;; Pso: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 +;; Psz: ~1 | ~2 | ~4 | ~8 | ~16 | ~32 | ~64 | ~128 ;; Q: pc relative load operand ;; Rxx: reserved for exotic register classes. ;; Sxx: extra memory (storage) constraints @@ -112,6 +114,12 @@ (match_test "ival >= -524288 && ival <= 524287") (match_test "TARGET_SH2A"))) +(define_constraint "I28" + "A signed 28-bit constant, as used in SH2A movi20s." + (and (match_code "const_int") + (match_test "ival >= -134217728 && ival <= 134217727") + (match_test "(ival & 255) == 0") + (match_test "TARGET_SH2A"))) (define_constraint "J16" "0xffffffff00000000 or 0x00000000ffffffff." (and (match_code "const_int") @@ -198,6 +206,30 @@ PIC_DIRECT_ADDR_P." (match_test "IS_NON_EXPLICIT_CONSTANT_P (op)")) +(define_constraint "Pso" + "Integer constant with a single bit set in its lower 8-bit." + (and (match_code "const_int") + (ior (match_test "ival == 1") + (match_test "ival == 2") + (match_test "ival == 4") + (match_test "ival == 8") + (match_test "ival == 16") + (match_test "ival == 32") + (match_test "ival == 64") + (match_test "ival == 128")))) + +(define_constraint "Psz" + "Integer constant with a single zero bit in the lower 8-bit." + (and (match_code "const_int") + (ior (match_test "~ival == 1") + (match_test "~ival == 2") + (match_test "~ival == 4") + (match_test "~ival == 8") + (match_test "~ival == 16") + (match_test "~ival == 32") + (match_test "~ival == 64") + (match_test "~ival == 128")))) + (define_memory_constraint "Sr0" "@internal" (and (match_test "memory_operand (op, GET_MODE (op))") diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index 25d9ce43392..9e1a4882354 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -134,6 +134,7 @@ extern int initial_elimination_offset (int, int); extern int fldi_ok (void); extern int sh_hard_regno_rename_ok (unsigned int, unsigned int); extern int sh_cfun_interrupt_handler_p (void); +extern int sh_cfun_resbank_handler_p (void); extern int sh_attr_renesas_p (const_tree); extern int sh_cfun_attr_renesas_p (void); extern void sh_initialize_trampoline (rtx, rtx, rtx); @@ -170,6 +171,8 @@ struct secondary_reload_info; extern enum reg_class sh_secondary_reload (bool, rtx, enum reg_class, enum machine_mode, struct secondary_reload_info *); +extern int sh2a_get_function_vector_number (rtx); +extern int sh2a_is_function_vector_call (rtx); #endif /* ! GCC_SH_PROTOS_H */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index b43033b17ca..8bba3228a7c 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -69,6 +69,14 @@ int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch; #define GEN_ADD3 (*(TARGET_SHMEDIA64 ? gen_adddi3 : gen_addsi3)) #define GEN_SUB3 (*(TARGET_SHMEDIA64 ? gen_subdi3 : gen_subsi3)) +/* Used to simplify the logic below. Find the attributes wherever + they may be. */ +#define SH_ATTRIBUTES(decl) \ + (TYPE_P (decl)) ? TYPE_ATTRIBUTES (decl) \ + : DECL_ATTRIBUTES (decl) \ + ? (DECL_ATTRIBUTES (decl)) \ + : TYPE_ATTRIBUTES (TREE_TYPE (decl)) + /* Set to 1 by expand_prologue() when the function is an interrupt handler. */ int current_function_interrupt; @@ -185,6 +193,10 @@ static HOST_WIDE_INT rounded_frame_size (int); static rtx mark_constant_pool_use (rtx); const struct attribute_spec sh_attribute_table[]; static tree sh_handle_interrupt_handler_attribute (tree *, tree, tree, int, bool *); +static tree sh_handle_resbank_handler_attribute (tree *, tree, + tree, int, bool *); +static tree sh2a_handle_function_vector_handler_attribute (tree *, tree, + tree, int, bool *); static tree sh_handle_sp_switch_attribute (tree *, tree, tree, int, bool *); static tree sh_handle_trap_exit_attribute (tree *, tree, tree, int, bool *); static tree sh_handle_renesas_attribute (tree *, tree, tree, int, bool *); @@ -258,6 +270,8 @@ static int sh_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static bool sh_scalar_mode_supported_p (enum machine_mode); static int sh_dwarf_calling_convention (const_tree); +static void sh_encode_section_info (tree, rtx, int); +static int sh2a_function_vector_p (tree); /* Initialize the GCC target structure. */ @@ -449,6 +463,9 @@ static int sh_dwarf_calling_convention (const_tree); /* Return current register pressure for regmode. */ #define CURR_REGMODE_PRESSURE(MODE) curr_regmode_pressure[((MODE) == SImode) ? 0 : 1] +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO sh_encode_section_info + #ifdef SYMBIAN #undef TARGET_ENCODE_SECTION_INFO @@ -463,6 +480,9 @@ static int sh_dwarf_calling_convention (const_tree); #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD sh_secondary_reload +/* Machine-specific symbol_ref flags. */ +#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) + struct gcc_target targetm = TARGET_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ @@ -661,6 +681,8 @@ print_operand_address (FILE *stream, rtx x) 'd' print a V2SF reg as dN instead of fpN. 'm' print a pair `base,offset' or `base,index', for LD and ST. 'U' Likewise for {LD,ST}{HI,LO}. + 'V' print the position of a single bit set. + 'W' print the position of a single bit cleared. 'u' prints the lowest 16 bits of CONST_INT, as an unsigned value. 'o' output an operator. */ @@ -690,7 +712,11 @@ print_operand (FILE *stream, rtx x, int code) fprintf (stream, "trapa #%ld", (long) TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (trapa_attr)))); else if (sh_cfun_interrupt_handler_p ()) - fprintf (stream, "rte"); + { + if (sh_cfun_resbank_handler_p ()) + fprintf (stream, "resbank\n"); + fprintf (stream, "rte"); + } else fprintf (stream, "rts"); break; @@ -863,6 +889,22 @@ print_operand (FILE *stream, rtx x, int code) } break; + case 'V': + { + int num = exact_log2 (INTVAL (x)); + gcc_assert (num >= 0); + fprintf (stream, "#%d", num); + } + break; + + case 'W': + { + int num = exact_log2 (~INTVAL (x)); + gcc_assert (num >= 0); + fprintf (stream, "#%d", num); + } + break; + case 'd': gcc_assert (GET_CODE (x) == REG && GET_MODE (x) == V2SFmode); @@ -1022,6 +1064,19 @@ print_operand (FILE *stream, rtx x, int code) } } + +/* Encode symbol attributes of a SYMBOL_REF into its + SYMBOL_REF_FLAGS. */ +static void +sh_encode_section_info (tree decl, rtx rtl, int first) +{ + default_encode_section_info (decl, rtl, first); + + if (TREE_CODE (decl) == FUNCTION_DECL + && sh2a_function_vector_p (decl) && TARGET_SH2A) + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FUNCVEC_FUNCTION; +} + /* Like force_operand, but guarantees that VALUE ends up in TARGET. */ static void force_into (rtx value, rtx target) @@ -3716,7 +3771,8 @@ broken_move (rtx insn) && FP_REGISTER_P (REGNO (SET_DEST (pat)))) && ! (TARGET_SH2A && GET_MODE (SET_DEST (pat)) == SImode - && satisfies_constraint_I20 (SET_SRC (pat))) + && (satisfies_constraint_I20 (SET_SRC (pat)) + || satisfies_constraint_I28 (SET_SRC (pat)))) && ! satisfies_constraint_I08 (SET_SRC (pat))) return 1; } @@ -5767,7 +5823,16 @@ push_regs (HARD_REG_SET *mask, int interrupt_handler) if (i != PR_REG && (i != FPSCR_REG || ! skip_fpscr) && TEST_HARD_REG_BIT (*mask, i)) - push (i); + { + /* If the ISR has RESBANK attribute assigned, don't push any of + the following registers - R0-R14, MACH, MACL and GBR. */ + if (! (sh_cfun_resbank_handler_p () + && ((i >= FIRST_GENERAL_REG && i < LAST_GENERAL_REG) + || i == MACH_REG + || i == MACL_REG + || i == GBR_REG))) + push (i); + } } /* Push banked registers last to improve delay slot opportunities. */ @@ -5776,7 +5841,8 @@ push_regs (HARD_REG_SET *mask, int interrupt_handler) if (TEST_HARD_REG_BIT (*mask, i)) push (i); - if (TEST_HARD_REG_BIT (*mask, PR_REG)) + /* Don't push PR register for an ISR with RESBANK attribute assigned. */ + if (TEST_HARD_REG_BIT (*mask, PR_REG) && !sh_cfun_resbank_handler_p ()) push (PR_REG); } @@ -6705,7 +6771,10 @@ sh_expand_epilogue (bool sibcall_p) int last_reg; save_size = 0; - if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG)) + /* For an ISR with RESBANK attribute assigned, don't pop PR + register. */ + if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG) + && !sh_cfun_resbank_handler_p ()) { if (!frame_pointer_needed) emit_insn (gen_blockage ()); @@ -6733,7 +6802,15 @@ sh_expand_epilogue (bool sibcall_p) && hard_reg_set_intersect_p (live_regs_mask, reg_class_contents[DF_REGS])) fpscr_deferred = 1; - else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j)) + /* For an ISR with RESBANK attribute assigned, don't pop + following registers, R0-R14, MACH, MACL and GBR. */ + else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j) + && ! (sh_cfun_resbank_handler_p () + && ((j >= FIRST_GENERAL_REG + && j < LAST_GENERAL_REG) + || j == MACH_REG + || j == MACL_REG + || j == GBR_REG))) pop (j); if (j == FIRST_FP_REG && fpscr_deferred) @@ -7904,11 +7981,13 @@ sh_insert_attributes (tree node, tree *attributes) java frontend. */ attrs = tree_cons (get_identifier("interrupt_handler"), NULL_TREE, attrs); - /* However, for sp_switch, trap_exit and nosave_low_regs, if the - interrupt attribute is missing, we ignore the attribute and warn. */ + /* However, for sp_switch, trap_exit, nosave_low_regs and resbank, + if the interrupt attribute is missing, we ignore the attribute + and warn. */ else if (lookup_attribute ("sp_switch", attrs) || lookup_attribute ("trap_exit", attrs) - || lookup_attribute ("nosave_low_regs", attrs)) + || lookup_attribute ("nosave_low_regs", attrs) + || lookup_attribute ("resbank", attrs)) { tree *tail; @@ -7916,7 +7995,8 @@ sh_insert_attributes (tree node, tree *attributes) { if (is_attribute_p ("sp_switch", TREE_PURPOSE (attrs)) || is_attribute_p ("trap_exit", TREE_PURPOSE (attrs)) - || is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs))) + || is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs)) + || is_attribute_p ("resbank", TREE_PURPOSE (attrs))) warning (OPT_Wattributes, "%qs attribute only applies to interrupt functions", IDENTIFIER_POINTER (TREE_PURPOSE (attrs))); @@ -7963,6 +8043,8 @@ sh_insert_attributes (tree node, tree *attributes) renesas -- use Renesas calling/layout conventions (functions and structures). + resbank -- In case of an ISR, use a register bank to save registers + R0-R14, MACH, MACL, GBR and PR. This is useful only on SH2A targets. */ const struct attribute_spec sh_attribute_table[] = @@ -7974,6 +8056,8 @@ const struct attribute_spec sh_attribute_table[] = { "renesas", 0, 0, false, true, false, sh_handle_renesas_attribute }, { "trapa_handler", 0, 0, true, false, false, sh_handle_interrupt_handler_attribute }, { "nosave_low_regs", 0, 0, true, false, false, sh_handle_interrupt_handler_attribute }, + { "resbank", 0, 0, true, false, false, sh_handle_resbank_handler_attribute }, + { "function_vector", 1, 1, true, false, false, sh2a_handle_function_vector_handler_attribute }, #ifdef SYMBIAN /* Symbian support adds three new attributes: dllexport - for exporting a function/variable that will live in a dll @@ -7988,18 +8072,41 @@ const struct attribute_spec sh_attribute_table[] = { NULL, 0, 0, false, false, false, NULL } }; +/* Handle a 'resbank' attribute. */ +static tree +sh_handle_resbank_handler_attribute (tree * node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool * no_add_attrs) +{ + if (!TARGET_SH2A) + { + warning (OPT_Wattributes, "%qs attribute is supported only for SH2A", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + if (TREE_CODE (*node) != FUNCTION_DECL) + { + warning (OPT_Wattributes, "%qs attribute only applies to functions", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle an "interrupt_handler" attribute; arguments as in struct attribute_spec.handler. */ static tree sh_handle_interrupt_handler_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, - bool *no_add_attrs) + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_DECL) { warning (OPT_Wattributes, "%qs attribute only applies to functions", - IDENTIFIER_POINTER (name)); + IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (TARGET_SHCOMPACT) @@ -8011,6 +8118,96 @@ sh_handle_interrupt_handler_attribute (tree *node, tree name, return NULL_TREE; } +/* Handle an 'function_vector' attribute; arguments as in + struct attribute_spec.handler. */ +static tree +sh2a_handle_function_vector_handler_attribute (tree * node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool * no_add_attrs) +{ + if (!TARGET_SH2A) + { + warning (OPT_Wattributes, "%qs attribute only applies to SH2A", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (TREE_CODE (*node) != FUNCTION_DECL) + { + warning (OPT_Wattributes, "%qs attribute only applies to functions", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST) + { + /* The argument must be a constant integer. */ + warning (OPT_Wattributes, + "`%s' attribute argument not an integer constant", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (TREE_INT_CST_LOW (TREE_VALUE (args)) > 255) + { + /* The argument value must be between 0 to 255. */ + warning (OPT_Wattributes, + "`%s' attribute argument should be between 0 to 255", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + return NULL_TREE; +} + +/* Returns 1 if current function has been assigned the attribute + 'function_vector'. */ +int +sh2a_is_function_vector_call (rtx x) +{ + if (GET_CODE (x) == SYMBOL_REF + && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION)) + { + tree tr = SYMBOL_REF_DECL (x); + + if (sh2a_function_vector_p (tr)) + return 1; + } + + return 0; +} + +/* Returns the function vector number, if the the attribute + 'function_vector' is assigned, otherwise returns zero. */ +int +sh2a_get_function_vector_number (rtx x) +{ + int num; + tree list, t; + + if ((GET_CODE (x) == SYMBOL_REF) + && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION)) + { + t = SYMBOL_REF_DECL (x); + + if (TREE_CODE (t) != FUNCTION_DECL) + return 0; + + list = SH_ATTRIBUTES (t); + while (list) + { + if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) + { + num = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (list))); + return num; + } + + list = TREE_CHAIN (list); + } + + return 0; + } + else + return 0; +} + /* Handle an "sp_switch" attribute; arguments as in struct attribute_spec.handler. */ static tree @@ -8101,6 +8298,39 @@ sh_cfun_interrupt_handler_p (void) != NULL_TREE); } +/* Returns 1 if FUNC has been assigned the attribute + "function_vector". */ +int +sh2a_function_vector_p (tree func) +{ + tree list; + if (TREE_CODE (func) != FUNCTION_DECL) + return 0; + + list = SH_ATTRIBUTES (func); + while (list) + { + if (is_attribute_p ("function_vector", TREE_PURPOSE (list))) + return 1; + + list = TREE_CHAIN (list); + } + return 0; +} + +/* Returns TRUE if given tree has the "resbank" attribute. */ + +int +sh_cfun_resbank_handler_p (void) +{ + return ((lookup_attribute ("resbank", + DECL_ATTRIBUTES (current_function_decl)) + != NULL_TREE) + && (lookup_attribute ("interrupt_handler", + DECL_ATTRIBUTES (current_function_decl)) + != NULL_TREE) && TARGET_SH2A); +} + /* Implement TARGET_CHECK_PCH_TARGET_FLAGS. */ static const char * @@ -10393,6 +10623,9 @@ sh_expand_t_scc (enum rtx_code code, rtx target) val = INTVAL (sh_compare_op1); if ((code == EQ && val == 1) || (code == NE && val == 0)) emit_insn (gen_movt (result)); + else if (TARGET_SH2A && ((code == EQ && val == 0) + || (code == NE && val == 1))) + emit_insn (gen_movrt (result)); else if ((code == EQ && val == 0) || (code == NE && val == 1)) { emit_insn (gen_rtx_CLOBBER (VOIDmode, result)); diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 5a580b517cd..f62b3b9594a 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -3170,6 +3170,14 @@ label: andi %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*andsi3_bclr" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (and:SI (match_operand:SI 1 "arith_reg_operand" "%0") + (match_operand:SI 2 "const_int_operand" "Psz")))] + "TARGET_SH2A && satisfies_constraint_Psz (operands[2])" + "bclr\\t%W2,%0" + [(set_attr "type" "arith")]) + ;; If the constant is 255, then emit an extu.b instruction instead of an ;; and, since that will give better code. @@ -3252,6 +3260,14 @@ label: ori %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*iorsi3_bset" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (ior:SI (match_operand:SI 1 "arith_reg_operand" "%0") + (match_operand:SI 2 "const_int_operand" "Pso")))] + "TARGET_SH2A && satisfies_constraint_Pso (operands[2])" + "bset\\t%V2,%0" + [(set_attr "type" "arith")]) + (define_insn "iordi3" [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (ior:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") @@ -3326,6 +3342,15 @@ label: xori %1, %2, %0" [(set_attr "type" "arith_media")]) +;; Store the complements of the T bit in a register. +(define_insn "xorsi3_movrt" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (xor:SI (reg:SI T_REG) + (const_int 1)))] + "TARGET_SH2A" + "movrt\\t%0" + [(set_attr "type" "arith")]) + (define_insn "xordi3" [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (xor:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") @@ -4937,9 +4962,9 @@ label: ;; TARGET_FMOVD is in effect, and mode switching is done before reload. (define_insn "movsi_ie" [(set (match_operand:SI 0 "general_movdst_operand" - "=r,r,r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,<,r,y,r,*f,y,*f,y") + "=r,r,r,r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,<,r,y,r,*f,y,*f,y") (match_operand:SI 1 "general_movsrc_operand" - "Q,r,I08,I20,r,mr,x,l,t,r,x,l,r,r,>,>,>,y,i,r,y,y,*f,*f,y"))] + "Q,r,I08,I20,I28,r,mr,x,l,t,r,x,l,r,r,>,>,>,y,i,r,y,y,*f,*f,y"))] "(TARGET_SH2E || TARGET_SH2A) && (register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" @@ -4948,6 +4973,7 @@ label: mov %1,%0 mov %1,%0 movi20 %1,%0 + movi20s %1,%0 cmp/pl %1 mov.l %1,%0 sts %1,%0 @@ -4969,13 +4995,14 @@ label: flds %1,fpul fmov %1,%0 ! move optimized away" - [(set_attr "type" "pcload_si,move,movi8,move,*,load_si,mac_gp,prget,arith,store,mac_mem,pstore,gp_mac,prset,mem_mac,pload,load,fstore,pcload_si,gp_fpul,fpul_gp,fmove,fmove,fmove,nil") - (set_attr "late_fp_use" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,yes,*,*,yes,*,*,*,*") + [(set_attr "type" "pcload_si,move,movi8,move,move,*,load_si,mac_gp,prget,arith,store,mac_mem,pstore,gp_mac,prset,mem_mac,pload,load,fstore,pcload_si,gp_fpul,fpul_gp,fmove,fmove,fmove,nil") + (set_attr "late_fp_use" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,yes,*,*,yes,*,*,*,*") (set_attr_alternative "length" [(const_int 2) (const_int 2) (const_int 2) (const_int 4) + (const_int 4) (const_int 2) (if_then_else (ne (symbol_ref "TARGET_SH2A") (const_int 0)) @@ -7443,7 +7470,14 @@ label: (use (reg:PSI FPSCR_REG)) (clobber (reg:SI PR_REG))] "TARGET_SH1" - "jsr @%0%#" + "* + { + if (TARGET_SH2A && (dbr_sequence_length () == 0)) + return \"jsr/n\\t@%0\"; + else + return \"jsr\\t@%0%#\"; + }" + [(set_attr "type" "call") (set (attr "fp_mode") (if_then_else (eq_attr "fpu_single" "yes") @@ -7451,6 +7485,31 @@ label: (set_attr "needs_delay_slot" "yes") (set_attr "fp_set" "unknown")]) +;; This is TBR relative jump instruction for SH2A architecture. +;; Its use is enabled assigning an attribute "function_vector" +;; and the vector number to a function during its declaration. + +(define_insn "calli_tbr_rel" + [(call (mem (match_operand:SI 0 "symbol_ref_operand" "")) + (match_operand 1 "" "")) + (use (reg:PSI FPSCR_REG)) + (clobber (reg:SI PR_REG))] + "TARGET_SH2A && sh2a_is_function_vector_call (operands[0])" + "* +{ + unsigned HOST_WIDE_INT vect_num; + vect_num = sh2a_get_function_vector_number (operands[0]); + operands[2] = GEN_INT (vect_num * 4); + + return \"jsr/n\\t@@(%O2,tbr)\"; +}" + [(set_attr "type" "call") + (set (attr "fp_mode") + (if_then_else (eq_attr "fpu_single" "yes") + (const_string "single") (const_string "double"))) + (set_attr "needs_delay_slot" "no") + (set_attr "fp_set" "unknown")]) + ;; This is a pc-rel call, using bsrf, for use with PIC. (define_insn "calli_pcrel" @@ -7546,7 +7605,13 @@ label: (use (reg:PSI FPSCR_REG)) (clobber (reg:SI PR_REG))] "TARGET_SH1" - "jsr @%1%#" + "* + { + if (TARGET_SH2A && (dbr_sequence_length () == 0)) + return \"jsr/n\\t@%1\"; + else + return \"jsr\\t@%1%#\"; + }" [(set_attr "type" "call") (set (attr "fp_mode") (if_then_else (eq_attr "fpu_single" "yes") @@ -7554,6 +7619,32 @@ label: (set_attr "needs_delay_slot" "yes") (set_attr "fp_set" "unknown")]) +;; This is TBR relative jump instruction for SH2A architecture. +;; Its use is enabled assigning an attribute "function_vector" +;; and the vector number to a function during its declaration. + +(define_insn "call_valuei_tbr_rel" + [(set (match_operand 0 "" "=rf") + (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "")) + (match_operand 2 "" ""))) + (use (reg:PSI FPSCR_REG)) + (clobber (reg:SI PR_REG))] + "TARGET_SH2A && sh2a_is_function_vector_call (operands[1])" + "* +{ + unsigned HOST_WIDE_INT vect_num; + vect_num = sh2a_get_function_vector_number (operands[1]); + operands[3] = GEN_INT (vect_num * 4); + + return \"jsr/n\\t@@(%O3,tbr)\"; +}" + [(set_attr "type" "call") + (set (attr "fp_mode") + (if_then_else (eq_attr "fpu_single" "yes") + (const_string "single") (const_string "double"))) + (set_attr "needs_delay_slot" "no") + (set_attr "fp_set" "unknown")]) + (define_insn "call_valuei_pcrel" [(set (match_operand 0 "" "=rf") (call (mem:SI (match_operand:SI 1 "arith_reg_operand" "r")) @@ -7715,6 +7806,17 @@ label: emit_insn (gen_symGOTPLT2reg (reg, XEXP (operands[0], 0))); XEXP (operands[0], 0) = reg; } + if (!flag_pic && TARGET_SH2A + && GET_CODE (operands[0]) == MEM + && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) + { + if (sh2a_is_function_vector_call (XEXP (operands[0], 0))) + { + emit_call_insn (gen_calli_tbr_rel (XEXP (operands[0], 0), + operands[1])); + DONE; + } + } if (flag_pic && TARGET_SH2 && GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) @@ -7898,6 +8000,17 @@ label: emit_insn (gen_symGOTPLT2reg (reg, XEXP (operands[1], 0))); XEXP (operands[1], 0) = reg; } + if (!flag_pic && TARGET_SH2A + && GET_CODE (operands[1]) == MEM + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) + { + if (sh2a_is_function_vector_call (XEXP (operands[1], 0))) + { + emit_call_insn (gen_call_valuei_tbr_rel (operands[0], + XEXP (operands[1], 0), operands[2])); + DONE; + } + } if (flag_pic && TARGET_SH2 && GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) @@ -9262,7 +9375,14 @@ mov.l\\t1f,r0\\n\\ && reload_completed && lookup_attribute (\"trap_exit\", DECL_ATTRIBUTES (current_function_decl)) == NULL_TREE" - "%@ %#" + "* + { + if (TARGET_SH2A && (dbr_sequence_length () == 0) + && !current_function_interrupt) + return \"rts/n\"; + else + return \"%@ %#\"; + }" [(set_attr "type" "return") (set_attr "needs_delay_slot" "yes")]) @@ -9450,6 +9570,16 @@ mov.l\\t1f,r0\\n\\ "movt %0" [(set_attr "type" "arith")]) +;; complements the T bit and stores the result in a register +(define_insn "movrt" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (if_then_else (eq:SI (reg:SI T_REG) (const_int 0)) + (const_int 1) + (const_int 0)))] + "TARGET_SH2A" + "movrt\\t%0" + [(set_attr "type" "arith")]) + (define_expand "seq" [(set (match_operand:SI 0 "arith_reg_dest" "") (match_dup 1))] @@ -13621,7 +13751,8 @@ mov.l\\t1f,r0\\n\\ [(prefetch (match_operand 0 "address_operand" "p") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] - "(TARGET_HARD_SH4 || TARGET_SH5) && (TARGET_SHMEDIA || !TARGET_VXWORKS_RTP)" + "TARGET_SH2A || ((TARGET_HARD_SH4 || TARGET_SH5) + && (TARGET_SHMEDIA || !TARGET_VXWORKS_RTP))" " { if (GET_MODE (operands[0]) != Pmode @@ -13632,6 +13763,14 @@ mov.l\\t1f,r0\\n\\ operands[0] = force_reg (Pmode, operands[0]); }") +(define_insn "prefetch_m2a" + [(prefetch (match_operand:SI 0 "register_operand" "r") + (match_operand:SI 1 "const_int_operand" "n") + (match_operand:SI 2 "const_int_operand" "n"))] + "TARGET_SH2A" + "pref\\t@%0" + [(set_attr "type" "other")]) + (define_insn "alloco_i" [(set (mem:BLK (match_operand:QI 0 "cache_address_operand" "p")) (unspec:BLK [(const_int 0)] UNSPEC_ALLOCO))] diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh index 4f9934b27cc..4661ab7b53a 100644 --- a/gcc/config/sh/t-sh +++ b/gcc/config/sh/t-sh @@ -1,6 +1,5 @@ -sh-c.o: $(srcdir)/config/sh/sh-c.c \ - $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) $(TM_P_H) coretypes.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/sh/sh-c.c +sh-c.o: $(srcdir)/config/sh/sh-c.c + $(COMPILE) $< LIB1ASMSRC = sh/lib1funcs.asm LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \ diff --git a/gcc/config/sh/t-symbian b/gcc/config/sh/t-symbian index 1d15d59c059..f2c49d293c2 100644 --- a/gcc/config/sh/t-symbian +++ b/gcc/config/sh/t-symbian @@ -1,6 +1,5 @@ -sh-c.o: $(srcdir)/config/sh/sh-c.c \ - $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) $(TM_P_H) coretypes.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/sh/sh-c.c +sh-c.o: $(srcdir)/config/sh/sh-c.c + $(COMPILE) $< LIB1ASMSRC = sh/lib1funcs.asm LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ @@ -29,9 +28,8 @@ $(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES) $(out_object_file): gt-sh.h gt-sh.h : s-gtype ; @true -symbian.o: $(srcdir)/config/sh/symbian.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/sh/symbian.c +symbian.o: $(srcdir)/config/sh/symbian.c + $(COMPILE) $< # Local Variables: diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf index b9550a3d082..683f312e88a 100644 --- a/gcc/config/spu/t-spu-elf +++ b/gcc/config/spu/t-spu-elf @@ -63,21 +63,5 @@ EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -spu.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h \ - real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \ - $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \ - output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \ - $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h cfglayout.h \ - $(srcdir)/config/spu/spu-protos.h \ - $(srcdir)/config/spu/spu-builtins.h \ - $(srcdir)/config/spu/spu-builtins.def - -spu-c.o: $(srcdir)/config/spu/spu-c.c \ - $(srcdir)/config/spu/spu-protos.h \ - $(srcdir)/config/spu/spu-builtins.h \ - $(srcdir)/config/spu/spu-builtins.def \ - $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \ - $(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H) insn-codes.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/spu/spu-c.c - +spu-c.o: $(srcdir)/config/spu/spu-c.c + $(COMPILE) $< diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index a4c17463194..078b367554f 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -629,7 +629,12 @@ xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, if (GET_CODE (x) == PLUS && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 0)) - x = XEXP (x, 0); + { + x = XEXP (x, 0); + /* PR 31232: Do not allow INT+INT as an address. */ + if (GET_CODE (x) == CONST_INT) + return 0; + } if ((GET_CODE (x) == PRE_MODIFY && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT) diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin index 2949e6baad0..0a3f80cb935 100644 --- a/gcc/config/t-darwin +++ b/gcc/config/t-darwin @@ -1,21 +1,13 @@ -darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h \ - conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \ - reload.h function.h $(GGC_H) langhooks.h $(TARGET_H) $(TM_P_H) gt-darwin.h \ - config/darwin-sections.def - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin.c +darwin.o: $(srcdir)/config/darwin.c + $(COMPILE) $< -darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \ - c-incpath.h flags.h $(C_COMMON_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES) +darwin-c.o: $(srcdir)/config/darwin-c.c + $(COMPILE) $(PREPROCESSOR_DEFINES) $< gt-darwin.h : s-gtype ; @true -darwin-driver.o: $(srcdir)/config/darwin-driver.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/darwin-driver.c +darwin-driver.o: $(srcdir)/config/darwin-driver.c + $(COMPILE) $< # How to build crt3.o EXTRA_MULTILIB_PARTS=crt3.o diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2 index 2339a0bc98f..f592c0a39a3 100644 --- a/gcc/config/t-sol2 +++ b/gcc/config/t-sol2 @@ -1,12 +1,7 @@ # Solaris-specific format checking and pragmas -sol2-c.o: $(srcdir)/config/sol2-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - tree.h c-format.h intl.h $(CPPLIB_H) c-pragma.h $(TM_H) $(TM_P_H) \ - toplev.h $(C_COMMON_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/sol2-c.c +sol2-c.o: $(srcdir)/config/sol2-c.c + $(COMPILE) $< # Solaris-specific attributes -sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - tree.h $(TM_H) $(TM_P_H) toplev.h $(GGC_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/sol2.c +sol2.o: $(srcdir)/config/sol2.c + $(COMPILE) $< diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks index c9d69e0edce..8c1a28e3f0a 100644 --- a/gcc/config/t-vxworks +++ b/gcc/config/t-vxworks @@ -32,6 +32,5 @@ LIMITS_H_TEST = true EXTRA_MULTILIB_PARTS = -vxworks.o: $(srcdir)/config/vxworks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TARGET_H) toplev.h output.h $(TM_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +vxworks.o: $(srcdir)/config/vxworks.c + $(COMPILE) $< diff --git a/gcc/config/v850/t-v850 b/gcc/config/v850/t-v850 index 4890ee3a9ff..4d082baa630 100644 --- a/gcc/config/v850/t-v850 +++ b/gcc/config/v850/t-v850 @@ -88,9 +88,8 @@ MULTILIB_MATCHES = mv850e=mv850e1 TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow -v850-c.o: $(srcdir)/config/v850/v850-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/v850/v850-c.c +v850-c.o: $(srcdir)/config/v850/v850-c.c + $(COMPILE) $< # Local Variables: # mode: Makefile diff --git a/gcc/config/v850/t-v850e b/gcc/config/v850/t-v850e index 97724e58109..7f3e0b43f65 100644 --- a/gcc/config/v850/t-v850e +++ b/gcc/config/v850/t-v850e @@ -87,9 +87,8 @@ INSTALL_LIBGCC = install-multilib TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow -v850-c.o: $(srcdir)/config/v850/v850-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/v850/v850-c.c +v850-c.o: $(srcdir)/config/v850/v850-c.c + $(COMPILE) $< # Local Variables: # mode: Makefile diff --git a/gcc/config/x-darwin b/gcc/config/x-darwin index c2ffd7d5c89..0592ded7ab0 100644 --- a/gcc/config/x-darwin +++ b/gcc/config/x-darwin @@ -1,3 +1,2 @@ -host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h toplev.h config/host-darwin.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +host-darwin.o : $(srcdir)/config/host-darwin.c + $(COMPILE) $< diff --git a/gcc/config/x-hpux b/gcc/config/x-hpux index fa0c5553c3d..4cf9fa70e55 100644 --- a/gcc/config/x-hpux +++ b/gcc/config/x-hpux @@ -1,4 +1,2 @@ -host-hpux.o : $(srcdir)/config/host-hpux.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/host-hpux.c +host-hpux.o : $(srcdir)/config/host-hpux.c + $(COMPILE) $< diff --git a/gcc/config/x-linux b/gcc/config/x-linux index e4aa040bceb..cb549284b4e 100644 --- a/gcc/config/x-linux +++ b/gcc/config/x-linux @@ -1,4 +1,2 @@ -host-linux.o : $(srcdir)/config/host-linux.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/host-linux.c +host-linux.o : $(srcdir)/config/host-linux.c + $(COMPILE) $< diff --git a/gcc/config/x-solaris b/gcc/config/x-solaris index 59c7bf61f5c..b3a946f2715 100644 --- a/gcc/config/x-solaris +++ b/gcc/config/x-solaris @@ -1,4 +1,2 @@ -host-solaris.o : $(srcdir)/config/host-solaris.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/host-solaris.c +host-solaris.o : $(srcdir)/config/host-solaris.c + $(COMPILE) $< diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 2fb0d345651..7340ba766b1 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -2542,7 +2542,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) if (arg_words >= MAX_ARGS_IN_REGISTERS) arg_words += 2; t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, - size_int (arg_words * UNITS_PER_WORD)); + build_int_cst (integer_type_node, arg_words * UNITS_PER_WORD)); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); } @@ -2607,8 +2607,10 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, { int align = MIN (TYPE_ALIGN (type), STACK_BOUNDARY) / BITS_PER_UNIT; - t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, size_int (align - 1)); - t = build2 (BIT_AND_EXPR, integer_type_node, t, size_int (-align)); + t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, + build_int_cst (integer_type_node, align - 1)); + t = build2 (BIT_AND_EXPR, integer_type_node, t, + build_int_cst (integer_type_node, -align)); t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, orig_ndx, t); gimplify_and_add (t, pre_p); } @@ -2639,7 +2641,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, lab_over = create_artificial_label (); t = build2 (GT_EXPR, boolean_type_node, ndx, - size_int (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); + build_int_cst (integer_type_node, + MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); t = build3 (COND_EXPR, void_type_node, t, build1 (GOTO_EXPR, void_type_node, lab_false), NULL_TREE); @@ -2669,7 +2672,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, lab_false2 = create_artificial_label (); t = build2 (GT_EXPR, boolean_type_node, orig_ndx, - size_int (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); + build_int_cst (integer_type_node, + MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); t = build3 (COND_EXPR, void_type_node, t, build1 (GOTO_EXPR, void_type_node, lab_false2), NULL_TREE); @@ -2714,7 +2718,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, else size = va_size; - t = build2 (MINUS_EXPR, sizetype, ndx, size); + t = fold_convert (sizetype, ndx); + t = build2 (MINUS_EXPR, sizetype, t, size); addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, array, t); addr = fold_convert (build_pointer_type (type), addr); diff --git a/gcc/configure.ac b/gcc/configure.ac index 3b86c951bea..cb6a089be71 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1682,6 +1682,9 @@ else --target=$target_alias --host=$build_alias --build=$build_alias CFLAGS="${saved_CFLAGS}" + # Extract this setting from the temporary Makefile. + BUILD_DEPMODE=`grep '^CCDEPMODE = ' Makefile | sed -e 's,.* = ,,'` + # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. mv auto-host.h ../auto-build.h @@ -3867,6 +3870,27 @@ do done # -------- +# Dependency checking. +# -------- + +ZW_CREATE_DEPDIR +AC_CONFIG_COMMANDS([gccdepdir],[ + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs build/$DEPDIR + for lang in $subdirs + do + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/mkinstalldirs $lang/$DEPDIR + done], [subdirs="$subdirs" ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR]) + +ZW_PROG_COMPILER_DEPENDENCIES([CC]) +# Note that if build!=host then we extracted the value from the +# temporary Makefile we created above, when we ran configure. +if test "${build}" = "${host}" ; then + BUILD_DEPMODE='$(CCDEPMODE)' +fi +AC_SUBST(BUILD_DEPMODE) + + +# -------- # UNSORTED # -------- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ce147f76da1..60eb1a35b9f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,236 @@ +2008-03-26 Jakub Jelinek <jakub@redhat.com> + + PR c++/35332 + * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR + and LTGT_EXPR to pp_expression. + +2008-03-26 Douglas Gregor <doug.gregor@gmail.com> + + * pt.c (coerce_template_template_parm): Moved the body of the loop + of coerce_template_template_parms here, to make iteration over a + template argument pack simpler. + Also, allow matching of a template parameter pack in the template + template parameter to a template parameter in the template + template argument. + (coerce_template_template_parms): Deal with variadic template + template parameters. Use coerce_template_template_parm. + (unify): Make sure we coerce the template template argument's + template arguments to the template template parameter's template + parameters, not the other way around. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in: Remove .o targets. + (cp/g++spec.o): Moved to cp/. Reduce to variable setting. + (GXX_OBJS): Update. + (c++_OBJS): New variable. + (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove. + +2008-03-25 Douglas Gregor <doug.gregor@gmail.com> + + * typeck.c (composite_pointer_type_r): Add SFINAE support. + (composite_pointer_type): Ditto. + (common_type): Fix call to composite_pointer_type. + (cxx_sizeof_nowarn): New; used to be a macro. + (cxx_sizeof_expr): Add SFINAE support. + (cxx_alignof_expr): Ditto. + (decay_conversion): Fix calls for SFINAE support. + (rationalize_conditional_expr): Add SFINAE support. + (build_class_member_access_expr): Ditto. + (finish_class_member_access_expr): Ditto. + (build_x_indirect_ref): Ditto. + (build_indirect_ref): Original version renamed to + cp_build_indirect_ref; new version provides a bridge from + c-common. + (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE + support. + (get_member_function_from_ptrfunc): Fix calls for SFINAE support. + (build_function_call): Original version renamed to + cp_build_function_call; new version provides a bridge from + c-common. + (cp_build_function_call): Was build_function_call; added SFINAE + support. + (convert_arguments): Add SFINAE support. + (build_x_binary_op): Ditto. + (build_binary_op): Original version renamed to cp_build_binary_op; + new version provides a bridge from c-common. + (cp_build_binary_op): Was build_binary_op; added SFINAE support. + (pointer_diff): Fix calls for SFINAE. + (build_x_unary_op): Add SFINAE support. + (condition_conversion): Fix calls for SFINAE. + (build_unary_op): Original version renamed to cp_build_unary_op; + new version provides a bridge from c-common. + (cp_build_unary_op): Was build_unary_op; added SFINAE support. + (unary_complex_lvalue): Fix calls for SFINAE. + (build_x_conditional_expr): Add SFINAE support. + (build_x_compound_expr_from_list): Fix calls for SFINAE. + (build_x_compound_expr): Add SFINAE support. + (convert_ptrmem): Fix calls for SFINAE. + (build_static_cast_1): Add SFINAE support. + (build_static_cast): Ditto. + (build_reinterpret_cast_1): Ditto. + (build_reinterpret_cast): Ditto. + (build_const_cast_1): Ditto. + (build_const_cast): Ditto. + (build_c_cast): Ditto. + (build_modify_expr): Original version renamed to + cp_build_modify_expr; new version provides a bridge from c-common. + (cp_build_modify_expr): Was build_modify_expr; added SFINAE + support. + (build_x_modify_expr): Add SFINAE support. + (build_ptrmemfunc): Fix calls for SFINAE. + (convert_for_assignment): Add SFINAE support. + (convert_for_initialization): Ditto. + (check_return_expr): Fix calls for SFINAE. + (lvalue_or_else): Add SFINAE support. + * init.c (perform_member_init): Fix calls for SFINAE. + (emit_mem_initializers): Ditto. + (expand_virtual_init): Ditto. + (expand_cleanup_for_base): Ditto. + (build_aggr_init): Add SFINAE support. + (expand_default_init): Ditto. + (expand_aggr_init_1): Fix calls for SFINAE. + (build_offset_ref): Ditto. + (build_new_1): Add SFINAE support. + (build_new): Ditto. + (build_vec_delete_1): Fix calls for SFINAE. + (get_temp_regvar): Ditto. + (build_vec_init): Add SFINAE support. + (build_dtor_call): Fix calls for SFINAE. + (build_delete): Ditto. + (push_base_cleanups): Ditto. + (build_vec_delete_1): Ditto. + * class.c (build_base_path): Fix calls for SFINAE. + (build_simple_base_path): Ditto. + (convert_to_base_statically): Ditto. + (build_vfn_ref): Ditto. + (resolve_address_of_overloaded_function): Ditto. + * decl.c (check_initializer): Fix calls for SFINAE. + (register_dtor_fn): Ditto. + (compute_array_index_type): Ditto. + (finish_enum): Ditto. + (start_preparsed_function): Ditto. + (cxx_maybe_build_cleanup): Ditto. + * call.c (convert_like): Add COMPLAIN argument. + (convert_like_with_context): Ditto. + (build_this): Fix calls for SFINAE. + (build_user_type_conversion): Ditto. + (resolve_args): Ditto. + (build_new_function_call): Add SFINAE support. + (build_operator_new_call): Fix calls for SFINAE. + (build_object_call): Add SFINAE support. + (build_conditional_expr): Ditto. + (build_new_op): Ditto. + (build_op_delete_call): Fix calls for SFINAE. + (build_temp): Ditto. + (convert_like_real): Add SFINAE support. + (build_x_va_arg): Fix calls for SFINAE. + (convert_default_arg): Ditto. + (build_over_call): Add SFINAE support. + (build_java_interface_fn_ref): Fix calls for SFINAE. + (build_special_member_call): Add SFINAE support. + (build_new_method_call): Ditto. + (perform_implicit_conversion): Ditto. + (perform_direct_initialization_if_possible): Ditto. + (initialize_reference): Fix calls for SFINAE. + * method.c (do_build_assign_ref): Fix calls for SFINAE. + * rtti.c (build_headof): Fix calls for SFINAE. + (get_tinfo_decl_dynamic): Ditto. + (get_typeid): Ditto. + (build_dynamic_cast_1): Add SFINAE support. + (build_dynamic_cast): Ditto. + (tinfo_base_init): Fix calls for SFINAE. + * except.c (do_get_exception_ptr): Fix calls for SFINAE. + (do_end_catch): Ditto. + (initialize_handler_parm): Ditto. + (expand_start_catch_block): Ditto. + (do_allocate_exception): Ditto. + (do_free_exception): Ditto. + (build_throw): Ditto. + * cvt.c (build_up_reference): Fix calls for SFINAE. + (convert_to_reference): Ditto. + (ocp_convert): Ditto. + (convert_to_void): Add SFINAE support. + * tree.c (build_dummy_object): Fix calls for SFINAE. + (stabilize_expr): Ditto. + * cp-tree.h (build_conditional_expr): Add tsubst_flags_t + parameter. + (build_new_method_call): Ditto. + (build_special_member_call): Ditto. + (build_new_op): Ditto. + (perform_implicit_conversion): Ditto. + (perform_direct_initialization_if_possible): Ditto. + (convert_to_void): Ditto. + (build_aggr_init): Ditto. + (build_new): Ditto. + (build_vec_init): Ditto. + (build_dynamic_cast): Ditto. + (finish_call_expr): Ditto + (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter. + (cxx_sizeof_nowarn): Remove macro; add function declaration. + (build_class_member_access_expr): Add tsubst_flags_t parameter. + (finish_class_member_access_expr): Ditto. + (build_x_indirect_ref): Ditto. + (cp_build_indirect_ref): New. + (cp_build_function_call): Add tsubst_flags_t parameter. + (build_x_unary_op): Ditto. + (cp_build_unary_op): New. + (build_x_conditional_expr): Add tsubst_flags_t parameter. + (build_x_compound_expr): Ditto. + (build_compound_expr): Ditto. + (build_static_cast): Ditto. + (build_reinterpret_cast): Ditto. + (build_const_cast): Ditto. + (build_c_cast): Ditto. + (build_x_modify_expr): Ditto. + (cp_build_modify_expr): New. + (convert_for_initialization): Add tsubst_flags_t parameter. + (cp_build_binary_op): Remove macro; add function declaration. + (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter. + (lvalue_or_else): Ditto. + (build_functional_cast): Ditto. + * typeck2.c (digest_init): Fix calls for SFINAE. + (process_init_constructor_array): Ditto. + (process_init_constructor_record): Ditto. + (build_x_arrow): Ditto. + (build_m_component_ref): Ditto. + (build_functional_cast): Add SFINAE support. + * pt.c (tsubst_copy_and_build): Add (more) SFINAE support. + * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE. + (finish_expr_stmt): Ditto. + (finish_for_expr): Ditto. + (finish_asm_stmt): Ditto. + (finish_non_static_data_member): Ditto. + (finish_qualified_id_expr): Ditto. + (finish_call_expr): Add SFINAE support. + (finish_increment_expr): Fix calls for SFINAE. + (finish_unary_op_expr): Ditto. + (simplify_aggr_init_expr): Ditto. + (finish_omp_clauses): Ditto. + (finish_omp_for): Ditto. + (finish_omp_barrier): Ditto. + (finish_omo_flush): Ditto. + * decl2.c (grok_array_decl): Fix calls or SFINAE. + (build_anon_union_vars): Ditto. + (get_guard_cond): Ditto. + (set_guard): Ditto. + (one_static_initialization_or_destruction): Ditto. + (do_static_initialization_or_destruction): Ditto. + (generate_ctor_or_dtor_function): Ditto. + (build_offset_ref_call_from_tree): Ditto. + * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE. + (cp_parser_postfix_dot_deref_expression): Ditto. + (cp_parser_unary_expression): Ditto. + (cp_parser_new_expression): Ditto. + (cp_parser_cast_expression): Ditto. + (cp_parser_binary_expression): Ditto. + (cp_parser_question_colon_clause): Ditto. + (cp_parser_assignment_expression): Ditto. + (cp_parser_expression): Ditto. + (cp_parser_builtin_offsetof): Ditto. + (cp_parser_template_argument): Ditto. + (cp_parser_functional_cast): Ditto. + 2008-03-24 Tom Tromey <tromey@redhat.com> * lex.c (handle_pragma_interface): Don't copy the filename. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 6207ed13dd6..d6c46edb4c4 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -52,13 +52,11 @@ c++: cc1plus$(exeext) # Tell GNU make to ignore these if they exist. .PHONY: c++ -g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CONFIG_H) - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \ - $(INCLUDES) $(srcdir)/cp/g++spec.c) +cp/g++spec.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) # Create the compiler driver for g++. -GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o +GXX_OBJS = $(GCC_OBJS) cp/g++spec.o intl.o prefix.o version.o g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -86,6 +84,8 @@ CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ # Language-specific object files for C++. CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) +c++_OBJS = $(CXX_OBJS) dummy-checksum.o cc1plus-checksum.o cp/g++spec.o + # Use strict warnings for this front end. cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN) @@ -96,8 +96,6 @@ cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1plus-dummy$(exeext) > $@ -cc1plus-checksum.o : cc1plus-checksum.c - cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(GMPLIBS) @@ -216,83 +214,3 @@ c++.stageprofile: stageprofile-start -mv cp/*$(objext) stageprofile/cp c++.stagefeedback: stagefeedback-start -mv cp/*$(objext) stagefeedback/cp - -# -# .o: .h dependencies. -CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ - cp/cp-tree.def c-common.def $(FUNCTION_H) $(VARRAY_H) \ - $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \ - $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h - -CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H) - -cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ - $(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H) -cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h \ - $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h \ - $(DIAGNOSTIC_H) cp/cp-objcp-common.h -cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \ - output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(RTL_H) \ - cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \ - debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H) -cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h $(EXPR_H) \ - output.h except.h toplev.h $(RTL_H) $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ - $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) -cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \ - langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \ - $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h -cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \ - $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h -cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ - toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) -cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ - $(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H) -cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ - $(EXPR_H) $(DIAGNOSTIC_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h -cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) toplev.h \ - $(EXPR_H) -cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ - toplev.h except.h $(TARGET_H) -cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_H) \ - $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h -cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) toplev.h \ - convert.h $(TARGET_H) -cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) -cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ - insn-config.h $(INTEGRATE_H) $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \ - $(TARGET_H) debug.h $(TREE_FLOW_H) -cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) -cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ - $(TARGET_H) $(C_PRAGMA_H) gt-cp-rtti.h -cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ - toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) -cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ - toplev.h except.h $(TM_P_H) -cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \ - toplev.h $(RTL_H) except.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h \ - vecprim.h -cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ - $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) -cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ - gt-cp-repo.h -cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \ - $(FLAGS_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ - $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) -cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H) -cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \ - insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(TREE_GIMPLE_H) \ - $(TARGET_H) -cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \ - gt-cp-mangle.h $(TARGET_H) $(TM_P_H) -cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \ - output.h $(TARGET_H) -cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \ - $(TM_H) coretypes.h pointer-set.h - -cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \ - $(DIAGNOSTIC_H) $(FLAGS_H) debug.h - -cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \ - $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 41e6933f686..29dda07426f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -126,21 +126,21 @@ static struct z_candidate * tourney (struct z_candidate *); static int equal_functions (tree, tree); static int joust (struct z_candidate *, struct z_candidate *, bool); static int compare_ics (conversion *, conversion *); -static tree build_over_call (struct z_candidate *, int); +static tree build_over_call (struct z_candidate *, int, tsubst_flags_t); static tree build_java_interface_fn_ref (tree, tree); -#define convert_like(CONV, EXPR) \ +#define convert_like(CONV, EXPR, COMPLAIN) \ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ /*issue_conversion_warnings=*/true, \ - /*c_cast_p=*/false) -#define convert_like_with_context(CONV, EXPR, FN, ARGNO) \ - convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ - /*issue_conversion_warnings=*/true, \ - /*c_cast_p=*/false) + /*c_cast_p=*/false, (COMPLAIN)) +#define convert_like_with_context(CONV, EXPR, FN, ARGNO, COMPLAIN ) \ + convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ + /*issue_conversion_warnings=*/true, \ + /*c_cast_p=*/false, (COMPLAIN)) static tree convert_like_real (conversion *, tree, tree, int, int, bool, - bool); + bool, tsubst_flags_t); static void op_error (enum tree_code, enum tree_code, tree, tree, tree, const char *); -static tree build_object_call (tree, tree); +static tree build_object_call (tree, tree, tsubst_flags_t); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); static void print_z_candidate (const char *, struct z_candidate *); @@ -2418,7 +2418,7 @@ build_this (tree obj) if (processing_template_decl) return build_address (obj); - return build_unary_op (ADDR_EXPR, obj, 0); + return cp_build_unary_op (ADDR_EXPR, obj, 0, tf_warning_or_error); } /* Returns true iff functions are equivalent. Equivalent functions are @@ -2750,7 +2750,7 @@ build_user_type_conversion (tree totype, tree expr, int flags) { if (cand->second_conv->kind == ck_ambig) return error_mark_node; - expr = convert_like (cand->second_conv, expr); + expr = convert_like (cand->second_conv, expr, tf_warning_or_error); return convert_from_reference (expr); } return NULL_TREE; @@ -2773,7 +2773,7 @@ resolve_args (tree args) error ("invalid use of void expression"); return error_mark_node; } - else if (invalid_nonstatic_memfn_p (arg)) + else if (invalid_nonstatic_memfn_p (arg, tf_warning_or_error)) return error_mark_node; } return args; @@ -2837,7 +2837,8 @@ perform_overload_resolution (tree fn, or a static member function) with the ARGS. */ tree -build_new_function_call (tree fn, tree args, bool koenig_p) +build_new_function_call (tree fn, tree args, bool koenig_p, + tsubst_flags_t complain) { struct z_candidate *candidates, *cand; bool any_viable_p; @@ -2858,8 +2859,9 @@ build_new_function_call (tree fn, tree args, bool koenig_p) fn = remove_hidden_names (fn); if (!fn) { - error ("no matching function for call to %<%D(%A)%>", - DECL_NAME (OVL_CURRENT (orig_fn)), args); + if (complain & tf_error) + error ("no matching function for call to %<%D(%A)%>", + DECL_NAME (OVL_CURRENT (orig_fn)), args); return error_mark_node; } } @@ -2871,22 +2873,25 @@ build_new_function_call (tree fn, tree args, bool koenig_p) if (!cand) { - if (!any_viable_p && candidates && ! candidates->next) - return build_function_call (candidates->fn, args); - if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) - fn = TREE_OPERAND (fn, 0); - if (!any_viable_p) - error ("no matching function for call to %<%D(%A)%>", - DECL_NAME (OVL_CURRENT (fn)), args); - else - error ("call of overloaded %<%D(%A)%> is ambiguous", - DECL_NAME (OVL_CURRENT (fn)), args); - if (candidates) - print_z_candidates (candidates); + if (complain & tf_error) + { + if (!any_viable_p && candidates && ! candidates->next) + return cp_build_function_call (candidates->fn, args, complain); + if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) + fn = TREE_OPERAND (fn, 0); + if (!any_viable_p) + error ("no matching function for call to %<%D(%A)%>", + DECL_NAME (OVL_CURRENT (fn)), args); + else + error ("call of overloaded %<%D(%A)%> is ambiguous", + DECL_NAME (OVL_CURRENT (fn)), args); + if (candidates) + print_z_candidates (candidates); + } result = error_mark_node; } else - result = build_over_call (cand, LOOKUP_NORMAL); + result = build_over_call (cand, LOOKUP_NORMAL, complain); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); @@ -2997,11 +3002,11 @@ build_operator_new_call (tree fnname, tree args, *fn = cand->fn; /* Build the CALL_EXPR. */ - return build_over_call (cand, LOOKUP_NORMAL); + return build_over_call (cand, LOOKUP_NORMAL, tf_warning_or_error); } static tree -build_object_call (tree obj, tree args) +build_object_call (tree obj, tree args, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree fns, convs, mem_args = NULL_TREE; @@ -3012,9 +3017,10 @@ build_object_call (tree obj, tree args) if (TYPE_PTRMEMFUNC_P (type)) { - /* It's no good looking for an overloaded operator() on a - pointer-to-member-function. */ - error ("pointer-to-member function %E cannot be called without an object; consider using .* or ->*", obj); + if (complain & tf_error) + /* It's no good looking for an overloaded operator() on a + pointer-to-member-function. */ + error ("pointer-to-member function %E cannot be called without an object; consider using .* or ->*", obj); return error_mark_node; } @@ -3088,8 +3094,11 @@ build_object_call (tree obj, tree args) candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { - error ("no match for call to %<(%T) (%A)%>", TREE_TYPE (obj), args); - print_z_candidates (candidates); + if (complain & tf_error) + { + error ("no match for call to %<(%T) (%A)%>", TREE_TYPE (obj), args); + print_z_candidates (candidates); + } result = error_mark_node; } else @@ -3097,8 +3106,12 @@ build_object_call (tree obj, tree args) cand = tourney (candidates); if (cand == 0) { - error ("call of %<(%T) (%A)%> is ambiguous", TREE_TYPE (obj), args); - print_z_candidates (candidates); + if (complain & tf_error) + { + error ("call of %<(%T) (%A)%> is ambiguous", + TREE_TYPE (obj), args); + print_z_candidates (candidates); + } result = error_mark_node; } /* Since cand->fn will be a type, not a function, for a conversion @@ -3106,12 +3119,13 @@ build_object_call (tree obj, tree args) DECL_NAME here. */ else if (TREE_CODE (cand->fn) == FUNCTION_DECL && DECL_OVERLOADED_OPERATOR_P (cand->fn) == CALL_EXPR) - result = build_over_call (cand, LOOKUP_NORMAL); + result = build_over_call (cand, LOOKUP_NORMAL, complain); else { - obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1); + obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1, + complain); obj = convert_from_reference (obj); - result = build_function_call (obj, args); + result = cp_build_function_call (obj, args, complain); } } @@ -3232,7 +3246,8 @@ conditional_conversion (tree e1, tree e2) arguments to the conditional expression. */ tree -build_conditional_expr (tree arg1, tree arg2, tree arg3) +build_conditional_expr (tree arg1, tree arg2, tree arg3, + tsubst_flags_t complain) { tree arg2_type; tree arg3_type; @@ -3249,7 +3264,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) calculated only once. */ if (!arg2) { - if (pedantic) + if (pedantic && (complain & tf_error)) pedwarn ("ISO C++ forbids omitting the middle term of a ?: expression"); /* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */ @@ -3263,7 +3278,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) The first expr ession is implicitly converted to bool (clause _conv_). */ - arg1 = perform_implicit_conversion (boolean_type_node, arg1); + arg1 = perform_implicit_conversion (boolean_type_node, arg1, complain); /* If something has already gone wrong, just pass that fact up the tree. */ @@ -3327,16 +3342,19 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) result_type = void_type_node; else { - if (VOID_TYPE_P (arg2_type)) - error ("second operand to the conditional operator " - "is of type %<void%>, " - "but the third operand is neither a throw-expression " - "nor of type %<void%>"); - else - error ("third operand to the conditional operator " - "is of type %<void%>, " - "but the second operand is neither a throw-expression " - "nor of type %<void%>"); + if (complain & tf_error) + { + if (VOID_TYPE_P (arg2_type)) + error ("second operand to the conditional operator " + "is of type %<void%>, " + "but the third operand is neither a throw-expression " + "nor of type %<void%>"); + else + error ("third operand to the conditional operator " + "is of type %<void%>, " + "but the second operand is neither a throw-expression " + "nor of type %<void%>"); + } return error_mark_node; } @@ -3380,7 +3398,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } else if (conv2 && (!conv2->bad_p || !conv3)) { - arg2 = convert_like (conv2, arg2); + arg2 = convert_like (conv2, arg2, complain); arg2 = convert_from_reference (arg2); arg2_type = TREE_TYPE (arg2); /* Even if CONV2 is a valid conversion, the result of the @@ -3393,7 +3411,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } else if (conv3 && (!conv3->bad_p || !conv2)) { - arg3 = convert_like (conv3, arg3); + arg3 = convert_like (conv3, arg3, complain); arg3 = convert_from_reference (arg3); arg3_type = TREE_TYPE (arg3); if (error_operand_p (arg3)) @@ -3477,15 +3495,21 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { - op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); - print_z_candidates (candidates); + if (complain & tf_error) + { + op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); + print_z_candidates (candidates); + } return error_mark_node; } cand = tourney (candidates); if (!cand) { - op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); - print_z_candidates (candidates); + if (complain & tf_error) + { + op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); + print_z_candidates (candidates); + } return error_mark_node; } @@ -3495,11 +3519,11 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) the converted operands are used in place of the original operands for the remainder of this section. */ conv = cand->convs[0]; - arg1 = convert_like (conv, arg1); + arg1 = convert_like (conv, arg1, complain); conv = cand->convs[1]; - arg2 = convert_like (conv, arg2); + arg2 = convert_like (conv, arg2, complain); conv = cand->convs[2]; - arg3 = convert_like (conv, arg3); + arg3 = convert_like (conv, arg3, complain); } /* [expr.cond] @@ -3548,17 +3572,25 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) - warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", - arg2_type, arg3_type); + { + if (complain & tf_warning) + warning (0, + "enumeral mismatch in conditional expression: %qT vs %qT", + arg2_type, arg3_type); + } else if (extra_warnings && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE && !same_type_p (arg3_type, type_promotes_to (arg2_type))) || (TREE_CODE (arg3_type) == ENUMERAL_TYPE && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) - warning (0, "enumeral and non-enumeral type in conditional expression"); + { + if (complain & tf_warning) + warning (0, + "enumeral and non-enumeral type in conditional expression"); + } - arg2 = perform_implicit_conversion (result_type, arg2); - arg3 = perform_implicit_conversion (result_type, arg3); + arg2 = perform_implicit_conversion (result_type, arg2, complain); + arg3 = perform_implicit_conversion (result_type, arg3, complain); } /* [expr.cond] @@ -3585,17 +3617,19 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type))) { result_type = composite_pointer_type (arg2_type, arg3_type, arg2, - arg3, "conditional expression"); + arg3, "conditional expression", + complain); if (result_type == error_mark_node) return error_mark_node; - arg2 = perform_implicit_conversion (result_type, arg2); - arg3 = perform_implicit_conversion (result_type, arg3); + arg2 = perform_implicit_conversion (result_type, arg2, complain); + arg3 = perform_implicit_conversion (result_type, arg3, complain); } if (!result_type) { - error ("operands to ?: have different types %qT and %qT", - arg2_type, arg3_type); + if (complain & tf_error) + error ("operands to ?: have different types %qT and %qT", + arg2_type, arg3_type); return error_mark_node; } @@ -3707,7 +3741,7 @@ add_candidates (tree fns, tree args, tree build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, - bool *overloaded_p) + bool *overloaded_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree arglist, fnname; @@ -3747,7 +3781,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, gcc_unreachable (); case CALL_EXPR: - return build_object_call (arg1, arg2); + return build_object_call (arg1, arg2, complain); case TRUTH_ORIF_EXPR: case TRUTH_ANDIF_EXPR: @@ -3856,6 +3890,11 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, { case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: + /* Don't try anything fancy if we're not allowed to produce + errors. */ + if (!(complain & tf_error)) + return error_mark_node; + /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ if (flags & LOOKUP_COMPLAIN) @@ -3868,7 +3907,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, else code = PREDECREMENT_EXPR; result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, - overloaded_p); + overloaded_p, complain); break; /* The caller will deal with these. */ @@ -3880,7 +3919,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, break; default: - if (flags & LOOKUP_COMPLAIN) + if ((flags & LOOKUP_COMPLAIN) && (complain & tf_error)) { op_error (code, code2, arg1, arg2, arg3, "no match"); print_z_candidates (candidates); @@ -3894,7 +3933,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, cand = tourney (candidates); if (cand == 0) { - if (flags & LOOKUP_COMPLAIN) + if ((flags & LOOKUP_COMPLAIN) && (complain & tf_error)) { op_error (code, code2, arg1, arg2, arg3, "ambiguous overload"); print_z_candidates (candidates); @@ -3909,12 +3948,12 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, if (resolve_args (arglist) == error_mark_node) result = error_mark_node; else - result = build_over_call (cand, LOOKUP_NORMAL); + result = build_over_call (cand, LOOKUP_NORMAL, complain); } else { /* Give any warnings we noticed during overload resolution. */ - if (cand->warnings) + if (cand->warnings && (complain & tf_warning)) { struct candidate_warning *w; for (w = cand->warnings; w; w = w->next) @@ -3933,7 +3972,8 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) - != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) + != TYPE_MAIN_VARIANT (TREE_TYPE (arg2))) + && (complain & tf_warning)) { warning (0, "comparison between %q#T and %q#T", TREE_TYPE (arg1), TREE_TYPE (arg2)); @@ -3950,25 +3990,26 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, conv = cand->convs[0]; if (conv->kind == ck_ref_bind) conv = conv->u.next; - arg1 = convert_like (conv, arg1); + arg1 = convert_like (conv, arg1, complain); if (arg2) { conv = cand->convs[1]; if (conv->kind == ck_ref_bind) conv = conv->u.next; - arg2 = convert_like (conv, arg2); + arg2 = convert_like (conv, arg2, complain); } if (arg3) { conv = cand->convs[2]; if (conv->kind == ck_ref_bind) conv = conv->u.next; - arg3 = convert_like (conv, arg3); + arg3 = convert_like (conv, arg3, complain); } if (!expl_eq_arg1) { - warn_logical_operator (code, arg1, arg2); + if (complain & tf_warning) + warn_logical_operator (code, arg1, arg2); expl_eq_arg1 = true; } } @@ -3986,10 +4027,10 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, switch (code) { case MODIFY_EXPR: - return build_modify_expr (arg1, code2, arg2); + return cp_build_modify_expr (arg1, code2, arg2, complain); case INDIRECT_REF: - return build_indirect_ref (arg1, "unary *"); + return cp_build_indirect_ref (arg1, "unary *", complain); case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: @@ -4015,7 +4056,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, case BIT_AND_EXPR: case BIT_IOR_EXPR: case BIT_XOR_EXPR: - return cp_build_binary_op (code, arg1, arg2); + return cp_build_binary_op (code, arg1, arg2, complain); case UNARY_PLUS_EXPR: case NEGATE_EXPR: @@ -4027,16 +4068,18 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, case POSTDECREMENT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: - return build_unary_op (code, arg1, candidates != 0); + return cp_build_unary_op (code, arg1, candidates != 0, complain); case ARRAY_REF: return build_array_ref (arg1, arg2); case COND_EXPR: - return build_conditional_expr (arg1, arg2, arg3); + return build_conditional_expr (arg1, arg2, arg3, complain); case MEMBER_REF: - return build_m_component_ref (build_indirect_ref (arg1, NULL), arg2); + return build_m_component_ref (cp_build_indirect_ref (arg1, NULL, + complain), + arg2); /* The caller will deal with these. */ case ADDR_EXPR: @@ -4205,7 +4248,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, else args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); - return build_function_call (fn, args); + return cp_build_function_call (fn, args, tf_warning_or_error); } } @@ -4268,7 +4311,7 @@ build_temp (tree expr, tree type, int flags, expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - type, flags); + type, flags, tf_warning_or_error); if (warningcount > savew) *diagnostic_fn = warning0; else if (errorcount > savee) @@ -4317,7 +4360,7 @@ conversion_null_warnings (tree totype, tree expr, tree fn, int argnum) static tree convert_like_real (conversion *convs, tree expr, tree fn, int argnum, int inner, bool issue_conversion_warnings, - bool c_cast_p) + bool c_cast_p, tsubst_flags_t complain) { tree totype = convs->type; diagnostic_fn_t diagnostic_fn; @@ -4335,23 +4378,31 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, { expr = convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, - /*c_cast_p=*/false); + /*c_cast_p=*/false, + complain); break; } else if (t->kind == ck_ambig) return convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, - /*c_cast_p=*/false); + /*c_cast_p=*/false, + complain); else if (t->kind == ck_identity) break; } - permerror ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype); - if (fn) - permerror (" initializing argument %P of %qD", argnum, fn); + if (complain & tf_error) + { + permerror ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype); + if (fn) + permerror (" initializing argument %P of %qD", argnum, fn); + } + else + return error_mark_node; + return cp_convert (totype, expr); } - if (issue_conversion_warnings) + if (issue_conversion_warnings && (complain & tf_warning)) conversion_null_warnings (totype, expr, fn, argnum); switch (convs->kind) @@ -4367,7 +4418,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, for (i = 0; i < cand->num_convs; ++i) cand->convs[i]->user_conv_p = true; - expr = build_over_call (cand, LOOKUP_NORMAL); + expr = build_over_call (cand, LOOKUP_NORMAL, complain); /* If this is a constructor or a function returning an aggr type, we need to build up a TARGET_EXPR. */ @@ -4394,7 +4445,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING|LOOKUP_NO_CONVERSION, &diagnostic_fn)); - if (diagnostic_fn) + if (diagnostic_fn && (complain & tf_error)) { if (fn) diagnostic_fn @@ -4410,7 +4461,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, } case ck_identity: if (type_unknown_p (expr)) - expr = instantiate_type (totype, expr, tf_warning_or_error); + expr = instantiate_type (totype, expr, complain); /* Convert a constant to its underlying value, unless we are about to bind it to a reference, in which case we need to leave it as an lvalue. */ @@ -4436,7 +4487,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, expr = convert_like_real (convs->u.next, expr, fn, argnum, convs->kind == ck_ref_bind ? -1 : 1, convs->kind == ck_ref_bind ? issue_conversion_warnings : false, - c_cast_p); + c_cast_p, + complain); if (expr == error_mark_node) return error_mark_node; @@ -4453,10 +4505,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, /* We are going to bind a reference directly to a base-class subobject of EXPR. */ /* Build an expression for `*((base*) &expr)'. */ - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain); expr = convert_to_base (expr, build_pointer_type (totype), !c_cast_p, /*nonnull=*/true); - expr = build_indirect_ref (expr, "implicit conversion"); + expr = cp_build_indirect_ref (expr, "implicit conversion", complain); return expr; } @@ -4470,7 +4522,12 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, flags |= LOOKUP_NO_CONVERSION; expr = build_temp (expr, totype, flags, &diagnostic_fn); if (diagnostic_fn && fn) - diagnostic_fn (" initializing argument %P of %qD", argnum, fn); + { + if ((complain & tf_error)) + diagnostic_fn (" initializing argument %P of %qD", argnum, fn); + else if (diagnostic_fn == error) + return error_mark_node; + } return build_cplus_new (totype, expr); case ck_ref_bind: @@ -4482,7 +4539,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, VA_ARG_EXPR and CONSTRUCTOR expressions are special cases that need temporaries, even when their types are reference compatible with the type of reference being bound, so the - upcoming call to build_unary_op (ADDR_EXPR, expr, ...) + upcoming call to cp_build_unary_op (ADDR_EXPR, expr, ...) doesn't fail. */ if (convs->need_temporary_p || TREE_CODE (expr) == CONSTRUCTOR @@ -4494,16 +4551,19 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) && !TYPE_REF_IS_RVALUE (ref_type)) { - /* If the reference is volatile or non-const, we - cannot create a temporary. */ - if (lvalue & clk_bitfield) - error ("cannot bind bitfield %qE to %qT", - expr, ref_type); - else if (lvalue & clk_packed) - error ("cannot bind packed field %qE to %qT", - expr, ref_type); - else - error ("cannot bind rvalue %qE to %qT", expr, ref_type); + if (complain & tf_error) + { + /* If the reference is volatile or non-const, we + cannot create a temporary. */ + if (lvalue & clk_bitfield) + error ("cannot bind bitfield %qE to %qT", + expr, ref_type); + else if (lvalue & clk_packed) + error ("cannot bind packed field %qE to %qT", + expr, ref_type); + else + error ("cannot bind rvalue %qE to %qT", expr, ref_type); + } return error_mark_node; } /* If the source is a packed field, and we must use a copy @@ -4516,8 +4576,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, && CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)) { - error ("cannot bind packed field %qE to %qT", - expr, ref_type); + if (complain & tf_error) + error ("cannot bind packed field %qE to %qT", + expr, ref_type); return error_mark_node; } if (lvalue & clk_bitfield) @@ -4527,7 +4588,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, /* Take the address of the thing to which we will bind the reference. */ - expr = build_unary_op (ADDR_EXPR, expr, 1); + expr = cp_build_unary_op (ADDR_EXPR, expr, 1, complain); if (expr == error_mark_node) return error_mark_node; @@ -4652,7 +4713,7 @@ build_x_va_arg (tree expr, tree type) expr = convert (build_pointer_type (type1), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), call_builtin_trap (), expr); - expr = build_indirect_ref (expr, NULL); + expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); return expr; } @@ -4719,7 +4780,8 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum) { arg = digest_init (type, arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, - "default argument", fn, parmnum); + "default argument", fn, parmnum, + tf_warning_or_error); } else { @@ -4732,7 +4794,8 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum) if (!CONSTANT_CLASS_P (arg)) arg = unshare_expr (arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, - "default argument", fn, parmnum); + "default argument", fn, parmnum, + tf_warning_or_error); arg = convert_for_arg_passing (type, arg); } @@ -4845,7 +4908,7 @@ magic_varargs_p (tree fn) bitmask of various LOOKUP_* flags which apply to the call itself. */ static tree -build_over_call (struct z_candidate *cand, int flags) +build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) { tree fn = cand->fn; tree args = cand->args; @@ -4957,8 +5020,13 @@ build_over_call (struct z_candidate *cand, int flags) tree base_binfo; if (convs[i]->bad_p) - permerror ("passing %qT as %<this%> argument of %q#D discards qualifiers", - TREE_TYPE (argtype), fn); + { + if (complain & tf_error) + permerror ("passing %qT as %<this%> argument of %q#D discards qualifiers", + TREE_TYPE (argtype), fn); + else + return error_mark_node; + } /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type @@ -5008,10 +5076,13 @@ build_over_call (struct z_candidate *cand, int flags) conv = conv->u.next; val = convert_like_with_context - (conv, TREE_VALUE (arg), fn, i - is_method); + (conv, TREE_VALUE (arg), fn, i - is_method, complain); val = convert_for_arg_passing (type, val); - argarray[j++] = val; + if ((complain == tf_none) && val == error_mark_node) + return error_mark_node; + else + argarray[j++] = val; } /* Default arguments */ @@ -5067,7 +5138,7 @@ build_over_call (struct z_candidate *cand, int flags) if (targ) arg = targ; else - arg = build_indirect_ref (arg, 0); + arg = cp_build_indirect_ref (arg, 0, complain); /* [class.copy]: the copy constructor is implicitly defined even if the implementation elided its use. */ @@ -5091,7 +5162,7 @@ build_over_call (struct z_candidate *cand, int flags) && !move_fn_p (fn))) { tree to = stabilize_reference - (build_indirect_ref (TREE_VALUE (args), 0)); + (cp_build_indirect_ref (TREE_VALUE (args), 0, complain)); val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg); return val; @@ -5102,14 +5173,14 @@ build_over_call (struct z_candidate *cand, int flags) && TYPE_HAS_TRIVIAL_ASSIGN_REF (DECL_CONTEXT (fn))) { tree to = stabilize_reference - (build_indirect_ref (argarray[0], 0)); + (cp_build_indirect_ref (argarray[0], 0, complain)); tree type = TREE_TYPE (to); tree as_base = CLASSTYPE_AS_BASE (type); arg = argarray[1]; if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base))) { - arg = build_indirect_ref (arg, 0); + arg = cp_build_indirect_ref (arg, 0, complain); val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg); } else @@ -5121,12 +5192,12 @@ build_over_call (struct z_candidate *cand, int flags) arg2 = TYPE_SIZE_UNIT (as_base); arg1 = arg; - arg0 = build_unary_op (ADDR_EXPR, to, 0); + arg0 = cp_build_unary_op (ADDR_EXPR, to, 0, complain); t = implicit_built_in_decls[BUILT_IN_MEMCPY]; t = build_call_n (t, 3, arg0, arg1, arg2); t = convert (TREE_TYPE (arg0), t); - val = build_indirect_ref (t, 0); + val = cp_build_indirect_ref (t, 0, complain); } return val; @@ -5227,7 +5298,8 @@ build_java_interface_fn_ref (tree fn, tree instance) /* Look up the pointer to the runtime java.lang.Class object for `instance'. This is the first entry in the vtable. */ - klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), + klass_ref = build_vtbl_ref (cp_build_indirect_ref (instance, 0, + tf_warning_or_error), integer_zero_node); /* Get the java.lang.Class pointer for the interface being called. */ @@ -5300,7 +5372,7 @@ in_charge_arg_for_name (tree name) tree build_special_member_call (tree instance, tree name, tree args, - tree binfo, int flags) + tree binfo, int flags, tsubst_flags_t complain) { tree fns; /* The type of the subobject to be constructed or destroyed. */ @@ -5390,7 +5462,8 @@ build_special_member_call (tree instance, tree name, tree args, return build_new_method_call (instance, fns, args, TYPE_BINFO (BINFO_TYPE (binfo)), - flags, /*fn=*/NULL); + flags, /*fn=*/NULL, + complain); } /* Return the NAME, as a C string. The NAME indicates a function that @@ -5444,7 +5517,7 @@ name_as_c_string (tree name, tree type, bool *free_p) tree build_new_method_call (tree instance, tree fns, tree args, tree conversion_path, int flags, - tree *fn_p) + tree *fn_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; @@ -5477,7 +5550,8 @@ build_new_method_call (tree instance, tree fns, tree args, if (!BASELINK_P (fns)) { - error ("call to non-function %qD", fns); + if (complain & tf_error) + error ("call to non-function %qD", fns); return error_mark_node; } @@ -5594,21 +5668,24 @@ build_new_method_call (tree instance, tree fns, tree args, candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { - if (!COMPLETE_TYPE_P (basetype)) - cxx_incomplete_type_error (instance_ptr, basetype); - else + if (complain & tf_error) { - char *pretty_name; - bool free_p; - - pretty_name = name_as_c_string (name, basetype, &free_p); - error ("no matching function for call to %<%T::%s(%A)%#V%>", - basetype, pretty_name, user_args, - TREE_TYPE (TREE_TYPE (instance_ptr))); - if (free_p) - free (pretty_name); + if (!COMPLETE_TYPE_P (basetype)) + cxx_incomplete_type_error (instance_ptr, basetype); + else + { + char *pretty_name; + bool free_p; + + pretty_name = name_as_c_string (name, basetype, &free_p); + error ("no matching function for call to %<%T::%s(%A)%#V%>", + basetype, pretty_name, user_args, + TREE_TYPE (TREE_TYPE (instance_ptr))); + if (free_p) + free (pretty_name); + } + print_z_candidates (candidates); } - print_z_candidates (candidates); call = error_mark_node; } else @@ -5619,12 +5696,15 @@ build_new_method_call (tree instance, tree fns, tree args, char *pretty_name; bool free_p; - pretty_name = name_as_c_string (name, basetype, &free_p); - error ("call of overloaded %<%s(%A)%> is ambiguous", pretty_name, - user_args); - print_z_candidates (candidates); - if (free_p) - free (pretty_name); + if (complain & tf_error) + { + pretty_name = name_as_c_string (name, basetype, &free_p); + error ("call of overloaded %<%s(%A)%> is ambiguous", pretty_name, + user_args); + print_z_candidates (candidates); + if (free_p) + free (pretty_name); + } call = error_mark_node; } else @@ -5635,7 +5715,8 @@ build_new_method_call (tree instance, tree fns, tree args, && DECL_PURE_VIRTUAL_P (fn) && instance == current_class_ref && (DECL_CONSTRUCTOR_P (current_function_decl) - || DECL_DESTRUCTOR_P (current_function_decl))) + || DECL_DESTRUCTOR_P (current_function_decl)) + && (complain & tf_warning)) /* This is not an error, it is runtime undefined behavior. */ warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? @@ -5646,8 +5727,9 @@ build_new_method_call (tree instance, tree fns, tree args, if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE && is_dummy_object (instance_ptr)) { - error ("cannot call member function %qD without object", - fn); + if (complain & tf_error) + error ("cannot call member function %qD without object", + fn); call = error_mark_node; } else @@ -5659,7 +5741,7 @@ build_new_method_call (tree instance, tree fns, tree args, if (fn_p) *fn_p = fn; /* Build the actual CALL_EXPR. */ - call = build_over_call (cand, flags); + call = build_over_call (cand, flags, complain); /* In an expression of the form `a->f()' where `f' turns out to be a static member function, `a' is none-the-less evaluated. */ @@ -6608,7 +6690,7 @@ can_convert_arg_bad (tree to, tree from, tree arg) doing a bad conversion, convert_like will complain. */ tree -perform_implicit_conversion (tree type, tree expr) +perform_implicit_conversion (tree type, tree expr, tsubst_flags_t complain) { conversion *conv; void *p; @@ -6624,7 +6706,8 @@ perform_implicit_conversion (tree type, tree expr) LOOKUP_NORMAL); if (!conv) { - error ("could not convert %qE to %qT", expr, type); + if (complain & tf_error) + error ("could not convert %qE to %qT", expr, type); expr = error_mark_node; } else if (processing_template_decl) @@ -6636,7 +6719,7 @@ perform_implicit_conversion (tree type, tree expr) expr = build_nop (type, expr); } else - expr = convert_like (conv, expr); + expr = convert_like (conv, expr, complain); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); @@ -6655,7 +6738,8 @@ perform_implicit_conversion (tree type, tree expr) tree perform_direct_initialization_if_possible (tree type, tree expr, - bool c_cast_p) + bool c_cast_p, + tsubst_flags_t complain) { conversion *conv; void *p; @@ -6674,7 +6758,7 @@ perform_direct_initialization_if_possible (tree type, { expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - type, LOOKUP_NORMAL); + type, LOOKUP_NORMAL, complain); return build_cplus_new (type, expr); } @@ -6689,7 +6773,8 @@ perform_direct_initialization_if_possible (tree type, else expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, /*issue_conversion_warnings=*/false, - c_cast_p); + c_cast_p, + tf_warning_or_error); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); @@ -6824,7 +6909,8 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) /*fn=*/NULL_TREE, /*argnum=*/0, /*inner=*/-1, /*issue_conversion_warnings=*/true, - /*c_cast_p=*/false); + /*c_cast_p=*/false, + tf_warning_or_error); if (error_operand_p (expr)) expr = error_mark_node; else @@ -6897,17 +6983,18 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) } else /* Take the address of EXPR. */ - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); /* If a BASE_CONV was required, perform it now. */ if (base_conv_type) expr = (perform_implicit_conversion - (build_pointer_type (base_conv_type), expr)); + (build_pointer_type (base_conv_type), expr, + tf_warning_or_error)); expr = build_nop (type, expr); } } else /* Perform the conversion. */ - expr = convert_like (conv, expr); + expr = convert_like (conv, expr, tf_warning_or_error); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 154c3b3fc37..69acf11cdfc 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -284,7 +284,7 @@ build_base_path (enum tree_code code, if (!want_pointer) /* This must happen before the call to save_expr. */ - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); offset = BINFO_OFFSET (binfo); fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); @@ -345,7 +345,7 @@ build_base_path (enum tree_code code, interesting to the optimizers anyway. */ && !has_empty) { - expr = build_indirect_ref (expr, NULL); + expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); expr = build_simple_base_path (expr, binfo); if (want_pointer) expr = build_address (expr); @@ -370,10 +370,12 @@ build_base_path (enum tree_code code, t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); v_offset = convert (t, current_vtt_parm); - v_offset = build_indirect_ref (v_offset, NULL); + v_offset = cp_build_indirect_ref (v_offset, NULL, + tf_warning_or_error); } else - v_offset = build_vfield_ref (build_indirect_ref (expr, NULL), + v_offset = build_vfield_ref (cp_build_indirect_ref (expr, NULL, + tf_warning_or_error), TREE_TYPE (TREE_TYPE (expr))); v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset), @@ -381,7 +383,7 @@ build_base_path (enum tree_code code, v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); - v_offset = build_indirect_ref (v_offset, NULL); + v_offset = cp_build_indirect_ref (v_offset, NULL, tf_warning_or_error); TREE_CONSTANT (v_offset) = 1; TREE_INVARIANT (v_offset) = 1; @@ -425,7 +427,7 @@ build_base_path (enum tree_code code, null_test = NULL; if (!want_pointer) - expr = build_indirect_ref (expr, NULL); + expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); out: if (null_test) @@ -459,7 +461,7 @@ build_simple_base_path (tree expr, tree binfo) in the back end. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) - expr = build_indirect_ref (temp, NULL); + expr = cp_build_indirect_ref (temp, NULL, tf_warning_or_error); return expr; } @@ -551,7 +553,8 @@ convert_to_base_statically (tree expr, tree base) when processing a template because they do not handle C++-specific trees. */ gcc_assert (!processing_template_decl); - expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1); + expr = cp_build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1, + tf_warning_or_error); if (!integer_zerop (BINFO_OFFSET (base))) expr = fold_build2 (POINTER_PLUS_EXPR, pointer_type, expr, fold_convert (sizetype, BINFO_OFFSET (base))); @@ -648,13 +651,16 @@ build_vfn_ref (tree instance_ptr, tree idx) { tree aref; - aref = build_vtbl_ref_1 (build_indirect_ref (instance_ptr, 0), idx); + aref = build_vtbl_ref_1 (cp_build_indirect_ref (instance_ptr, 0, + tf_warning_or_error), + idx); /* When using function descriptors, the address of the vtable entry is treated as a function pointer. */ if (TARGET_VTABLE_USES_DESCRIPTORS) aref = build1 (NOP_EXPR, TREE_TYPE (aref), - build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1)); + cp_build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1, + tf_warning_or_error)); /* Remember this as a method reference, for later devirtualization. */ aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); @@ -6098,10 +6104,10 @@ resolve_address_of_overloaded_function (tree target_type, } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) - return build_unary_op (ADDR_EXPR, fn, 0); + return cp_build_unary_op (ADDR_EXPR, fn, 0, flags); else { - /* The target must be a REFERENCE_TYPE. Above, build_unary_op + /* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op will mark the function as addressed, but here we must do it explicitly. */ cxx_mark_addressable (fn); diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9afeed71fbe..8387fd790e0 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4061,7 +4061,8 @@ extern cp_parameter_declarator *no_parameters; extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); -extern tree build_conditional_expr (tree, tree, tree); +extern tree build_conditional_expr (tree, tree, tree, + tsubst_flags_t); extern tree build_addr_func (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); @@ -4069,13 +4070,17 @@ extern bool null_ptr_cst_p (tree); extern bool sufficient_parms_p (const_tree); extern tree type_decays_to (tree); extern tree build_user_type_conversion (tree, tree, int); -extern tree build_new_function_call (tree, tree, bool); +extern tree build_new_function_call (tree, tree, bool, + tsubst_flags_t); extern tree build_operator_new_call (tree, tree, tree *, tree *, tree *); extern tree build_new_method_call (tree, tree, tree, tree, int, - tree *); -extern tree build_special_member_call (tree, tree, tree, tree, int); -extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); + tree *, tsubst_flags_t); +extern tree build_special_member_call (tree, tree, tree, tree, int, + tsubst_flags_t); +extern tree build_new_op (enum tree_code, int, tree, + tree, tree, bool *, + tsubst_flags_t); extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree); extern bool can_convert (tree, tree); extern bool can_convert_arg (tree, tree, tree, int); @@ -4091,8 +4096,9 @@ extern bool is_properly_derived_from (tree, tree); extern tree initialize_reference (tree, tree, tree, tree *); extern tree make_temporary_var_for_ref_to_temp (tree, tree); extern tree strip_top_quals (tree); -extern tree perform_implicit_conversion (tree, tree); -extern tree perform_direct_initialization_if_possible (tree, tree, bool); +extern tree perform_implicit_conversion (tree, tree, tsubst_flags_t); +extern tree perform_direct_initialization_if_possible (tree, tree, bool, + tsubst_flags_t); extern tree in_charge_arg_for_name (tree); extern tree build_cxx_call (tree, int, tree *); #ifdef ENABLE_CHECKING @@ -4159,7 +4165,8 @@ extern tree force_rvalue (tree); extern tree ocp_convert (tree, tree, int, int); extern tree cp_convert (tree, tree); extern tree cp_convert_and_check (tree, tree); -extern tree convert_to_void (tree, const char */*implicit context*/); +extern tree convert_to_void (tree, const char */*implicit context*/, + tsubst_flags_t); extern tree convert_force (tree, tree, int); extern tree build_expr_type_conversion (int, tree, bool); extern tree type_promotes_to (tree); @@ -4336,14 +4343,17 @@ extern tree do_friend (tree, tree, tree, tree, enum overload_flags, bool); /* in init.c */ extern tree expand_member_init (tree); extern void emit_mem_initializers (tree); -extern tree build_aggr_init (tree, tree, int); +extern tree build_aggr_init (tree, tree, int, + tsubst_flags_t); extern int is_class_type (tree, int); extern tree get_type_value (tree); extern tree build_zero_init (tree, tree, bool); extern tree build_value_init (tree); extern tree build_offset_ref (tree, tree, bool); -extern tree build_new (tree, tree, tree, tree, int); -extern tree build_vec_init (tree, tree, tree, bool, int); +extern tree build_new (tree, tree, tree, tree, int, + tsubst_flags_t); +extern tree build_vec_init (tree, tree, tree, bool, int, + tsubst_flags_t); extern tree build_default_init (tree, tree); extern tree build_delete (tree, tree, special_function_kind, @@ -4482,7 +4492,7 @@ extern tree build_typeid (tree); extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); extern tree build_headof (tree); -extern tree build_dynamic_cast (tree, tree); +extern tree build_dynamic_cast (tree, tree, tsubst_flags_t); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); @@ -4613,7 +4623,8 @@ extern tree finish_stmt_expr_expr (tree, tree); extern tree finish_stmt_expr (tree, bool); extern tree stmt_expr_value_expr (tree); extern tree perform_koenig_lookup (tree, tree); -extern tree finish_call_expr (tree, tree, bool, bool); +extern tree finish_call_expr (tree, tree, bool, bool, + tsubst_flags_t); extern tree finish_increment_expr (tree, enum tree_code); extern tree finish_this_expr (void); extern tree finish_pseudo_destructor_expr (tree, tree, tree); @@ -4762,36 +4773,49 @@ extern bool comptypes (tree, tree, int); extern bool compparms (const_tree, const_tree); extern int comp_cv_qualification (const_tree, const_tree); extern int comp_cv_qual_signature (tree, tree); -extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); +extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool); extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); -#define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) +extern tree cxx_sizeof_nowarn (tree); extern tree inline_conversion (tree); extern tree is_bitfield_expr_with_lowered_type (const_tree); extern tree unlowered_expr_type (const_tree); extern tree decay_conversion (tree); -extern tree build_class_member_access_expr (tree, tree, tree, bool); -extern tree finish_class_member_access_expr (tree, tree, bool); -extern tree build_x_indirect_ref (tree, const char *); -extern tree build_indirect_ref (tree, const char *); +extern tree build_class_member_access_expr (tree, tree, tree, bool, + tsubst_flags_t); +extern tree finish_class_member_access_expr (tree, tree, bool, + tsubst_flags_t); +extern tree build_x_indirect_ref (tree, const char *, + tsubst_flags_t); +extern tree cp_build_indirect_ref (tree, const char *, + tsubst_flags_t); extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); +extern tree cp_build_function_call (tree, tree, tsubst_flags_t); extern tree build_x_binary_op (enum tree_code, tree, enum tree_code, tree, - enum tree_code, bool *); -extern tree build_x_unary_op (enum tree_code, tree); + enum tree_code, bool *, + tsubst_flags_t); +extern tree build_x_unary_op (enum tree_code, tree, + tsubst_flags_t); +extern tree cp_build_unary_op (enum tree_code, tree, int, + tsubst_flags_t); extern tree unary_complex_lvalue (enum tree_code, tree); -extern tree build_x_conditional_expr (tree, tree, tree); +extern tree build_x_conditional_expr (tree, tree, tree, + tsubst_flags_t); extern tree build_x_compound_expr_from_list (tree, const char *); -extern tree build_x_compound_expr (tree, tree); -extern tree build_compound_expr (tree, tree); -extern tree build_static_cast (tree, tree); -extern tree build_reinterpret_cast (tree, tree); -extern tree build_const_cast (tree, tree); -extern tree build_c_cast (tree, tree); -extern tree build_x_modify_expr (tree, enum tree_code, tree); -extern tree build_modify_expr (tree, enum tree_code, tree); +extern tree build_x_compound_expr (tree, tree, tsubst_flags_t); +extern tree build_compound_expr (tree, tree, tsubst_flags_t); +extern tree build_static_cast (tree, tree, tsubst_flags_t); +extern tree build_reinterpret_cast (tree, tree, tsubst_flags_t); +extern tree build_const_cast (tree, tree, tsubst_flags_t); +extern tree build_c_cast (tree, tree, tsubst_flags_t); +extern tree build_x_modify_expr (tree, enum tree_code, tree, + tsubst_flags_t); +extern tree cp_build_modify_expr (tree, enum tree_code, tree, + tsubst_flags_t); extern tree convert_for_initialization (tree, tree, tree, int, - const char *, tree, int); + const char *, tree, int, + tsubst_flags_t); extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (const_tree, const_tree); @@ -4805,21 +4829,22 @@ extern tree build_ptrmemfunc1 (tree, tree, tree); extern void expand_ptrmemfunc_cst (tree, tree *, tree *); extern tree type_after_usual_arithmetic_conversions (tree, tree); extern tree composite_pointer_type (tree, tree, tree, tree, - const char*); + const char*, tsubst_flags_t); extern tree merge_types (tree, tree); extern tree check_return_expr (tree, bool *); -#define cp_build_binary_op(code, arg1, arg2) \ - build_binary_op(code, arg1, arg2, 1) +extern tree cp_build_binary_op (enum tree_code, tree, tree, + tsubst_flags_t); #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) extern tree build_ptrmemfunc_access_expr (tree, tree); extern tree build_address (tree); extern tree build_nop (tree, tree); extern tree non_reference (tree); extern tree lookup_anon_field (tree, tree); -extern bool invalid_nonstatic_memfn_p (const_tree); +extern bool invalid_nonstatic_memfn_p (const_tree, tsubst_flags_t); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); -extern int lvalue_or_else (const_tree, enum lvalue_use); +extern int lvalue_or_else (const_tree, enum lvalue_use, + tsubst_flags_t); extern int lvalue_p (const_tree); /* in typeck2.c */ @@ -4840,7 +4865,7 @@ extern tree digest_init (tree, tree); extern tree build_scoped_ref (tree, tree, tree *); extern tree build_x_arrow (tree); extern tree build_m_component_ref (tree, tree); -extern tree build_functional_cast (tree, tree); +extern tree build_functional_cast (tree, tree, tsubst_flags_t); extern tree add_exception_specifier (tree, tree, int); extern tree merge_exception_specifiers (tree, tree); diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 64a871650e1..fe1ed29ec65 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -326,7 +326,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) /* If we had a way to wrap this up, and say, if we ever needed its address, transform all occurrences of the register, into a memory reference we could win better. */ - rval = build_unary_op (ADDR_EXPR, arg, 1); + rval = cp_build_unary_op (ADDR_EXPR, arg, 1, tf_warning_or_error); if (rval == error_mark_node) return error_mark_node; @@ -470,7 +470,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); - rval = build_unary_op (ADDR_EXPR, expr, 0); + rval = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); if (rval != error_mark_node) rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), rval, 0); @@ -480,7 +480,8 @@ convert_to_reference (tree reftype, tree expr, int convtype, else { rval = convert_for_initialization (NULL_TREE, type, expr, flags, - "converting", 0, 0); + "converting", 0, 0, + tf_warning_or_error); if (rval == NULL_TREE || rval == error_mark_node) return rval; warn_ref_binding (reftype, intype, decl); @@ -630,7 +631,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags) if (code == VOID_TYPE && (convtype & CONV_STATIC)) { - e = convert_to_void (e, /*implicit=*/NULL); + e = convert_to_void (e, /*implicit=*/NULL, tf_warning_or_error); return e; } @@ -734,7 +735,8 @@ ocp_convert (tree type, tree expr, int convtype, int flags) ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, ctor), - type, flags); + type, flags, + tf_warning_or_error); if (ctor) return build_cplus_new (type, ctor); } @@ -763,18 +765,19 @@ ocp_convert (tree type, tree expr, int convtype, int flags) IMPLICIT is tells us the context of an implicit void conversion. */ tree -convert_to_void (tree expr, const char *implicit) +convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) { if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; if (!TREE_TYPE (expr)) return expr; - if (invalid_nonstatic_memfn_p (expr)) + if (invalid_nonstatic_memfn_p (expr, complain)) return error_mark_node; if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR) { - error ("pseudo-destructor is not called"); + if (complain & tf_error) + error ("pseudo-destructor is not called"); return error_mark_node; } if (VOID_TYPE_P (TREE_TYPE (expr))) @@ -788,10 +791,10 @@ convert_to_void (tree expr, const char *implicit) tree op2 = TREE_OPERAND (expr,2); tree new_op1 = convert_to_void (op1, (implicit && !TREE_SIDE_EFFECTS (op2) - ? "second operand of conditional" : NULL)); + ? "second operand of conditional" : NULL), complain); tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) - ? "third operand of conditional" : NULL)); + ? "third operand of conditional" : NULL), complain); expr = build3 (COND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1, new_op2); @@ -804,7 +807,7 @@ convert_to_void (tree expr, const char *implicit) tree op1 = TREE_OPERAND (expr,1); tree new_op1 = convert_to_void (op1, (implicit && !TREE_NO_WARNING (expr) - ? "right-hand operand of comma" : NULL)); + ? "right-hand operand of comma" : NULL), complain); if (new_op1 != op1) { @@ -834,14 +837,20 @@ convert_to_void (tree expr, const char *implicit) /* Can't load the value if we don't know the type. */ if (is_volatile && !is_complete) - warning (0, "object of incomplete type %qT will not be accessed in %s", - type, implicit ? implicit : "void context"); + { + if (complain & tf_warning) + warning (0, "object of incomplete type %qT will not be accessed in %s", + type, implicit ? implicit : "void context"); + } /* Don't load the value if this is an implicit dereference, or if the type needs to be handled by ctors/dtors. */ else if (is_volatile && (is_reference || TREE_ADDRESSABLE (type))) - warning (0, "object of type %qT will not be accessed in %s", - TREE_TYPE (TREE_OPERAND (expr, 0)), - implicit ? implicit : "void context"); + { + if (complain & tf_warning) + warning (0, "object of type %qT will not be accessed in %s", + TREE_TYPE (TREE_OPERAND (expr, 0)), + implicit ? implicit : "void context"); + } if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type)) expr = TREE_OPERAND (expr, 0); @@ -854,7 +863,7 @@ convert_to_void (tree expr, const char *implicit) tree type = TREE_TYPE (expr); int is_complete = COMPLETE_TYPE_P (complete_type (type)); - if (TYPE_VOLATILE (type) && !is_complete) + if (TYPE_VOLATILE (type) && !is_complete && (complain & tf_warning)) warning (0, "object %qE of incomplete type %qT will not be accessed in %s", expr, type, implicit ? implicit : "void context"); break; @@ -892,15 +901,19 @@ convert_to_void (tree expr, const char *implicit) { /* [over.over] enumerates the places where we can take the address of an overloaded function, and this is not one of them. */ - error ("%s cannot resolve address of overloaded function", - implicit ? implicit : "void cast"); + if (complain & tf_error) + error ("%s cannot resolve address of overloaded function", + implicit ? implicit : "void cast"); + else + return error_mark_node; expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) { /* Only warn when there is no &. */ - warning (OPT_Waddress, "%s is a reference, not call, to function %qE", - implicit, expr); + if (complain & tf_warning) + warning (OPT_Waddress, "%s is a reference, not call, to function %qE", + implicit, expr); if (TREE_CODE (expr) == COMPONENT_REF) expr = TREE_OPERAND (expr, 0); } @@ -915,8 +928,10 @@ convert_to_void (tree expr, const char *implicit) { /* The middle end does not warn about expressions that have been explicitly cast to void, so we must do so here. */ - if (!TREE_SIDE_EFFECTS (expr)) - warning (OPT_Wunused_value, "%s has no effect", implicit); + if (!TREE_SIDE_EFFECTS (expr)) { + if (complain & tf_warning) + warning (OPT_Wunused_value, "%s has no effect", implicit); + } else { tree e; @@ -939,7 +954,7 @@ convert_to_void (tree expr, const char *implicit) code = TREE_CODE (e); class = TREE_CODE_CLASS (code); - if (class == tcc_comparison + if ((class == tcc_comparison || class == tcc_unary || (class == tcc_binary && !(code == MODIFY_EXPR @@ -948,6 +963,7 @@ convert_to_void (tree expr, const char *implicit) || code == PREINCREMENT_EXPR || code == POSTDECREMENT_EXPR || code == POSTINCREMENT_EXPR))) + && (complain & tf_warning)) warning (OPT_Wunused_value, "value computed is not used"); } } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8353b9b64c3..df0b78c1971 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5027,7 +5027,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); current_stmt_tree ()->stmts_are_full_exprs_p = 1; } - init = build_aggr_init (decl, init, flags); + init = build_aggr_init (decl, init, flags, tf_warning_or_error); if (building_stmt_tree ()) current_stmt_tree ()->stmts_are_full_exprs_p = saved_stmts_are_full_exprs_p; @@ -5978,7 +5978,7 @@ register_dtor_fn (tree decl) addr = build_address (decl); /* The declared type of the parameter to "__cxa_atexit" is "void *". For plain "T*", we could just let the - machinery in build_function_call convert it -- but if the + machinery in cp_build_function_call convert it -- but if the type is "cv-qualified T *", then we need to convert it before passing it in, to avoid spurious errors. */ addr = build_nop (ptr_type_node, addr); @@ -5990,7 +5990,8 @@ register_dtor_fn (tree decl) other value. */ addr = null_pointer_node; args = tree_cons (NULL_TREE, - build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0), + cp_build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0, + tf_warning_or_error), NULL_TREE); if (targetm.cxx.use_aeabi_atexit ()) { @@ -6005,7 +6006,8 @@ register_dtor_fn (tree decl) } else args = tree_cons (NULL_TREE, cleanup, NULL_TREE); - return build_function_call (get_atexit_node (), args); + return cp_build_function_call (get_atexit_node (), args, + tf_warning_or_error); } /* DECL is a VAR_DECL with static storage duration. INIT, if present, @@ -7082,7 +7084,8 @@ compute_array_index_type (tree name, tree size) processing_template_decl = 0; itype = cp_build_binary_op (MINUS_EXPR, cp_convert (ssizetype, size), - cp_convert (ssizetype, integer_one_node)); + cp_convert (ssizetype, integer_one_node), + tf_warning_or_error); itype = fold (itype); processing_template_decl = saved_processing_template_decl; @@ -10820,7 +10823,8 @@ finish_enum (tree enumtype) saved_location = input_location; input_location = DECL_SOURCE_LOCATION (decl); value = perform_implicit_conversion (underlying_type, - DECL_INITIAL (decl)); + DECL_INITIAL (decl), + tf_warning_or_error); input_location = saved_location; /* Do not clobber shared ints. */ @@ -11282,7 +11286,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) gcc_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE); cp_function_chain->x_current_class_ref - = build_indirect_ref (t, NULL); + = cp_build_indirect_ref (t, NULL, tf_warning_or_error); cp_function_chain->x_current_class_ptr = t; /* Constructors and destructors need to know whether they're "in @@ -12199,8 +12203,9 @@ cxx_maybe_build_cleanup (tree decl) fn = lookup_name (id); arg = build_address (decl); mark_used (decl); - cleanup = build_function_call (fn, build_tree_list (NULL_TREE, - arg)); + cleanup = cp_build_function_call (fn, build_tree_list (NULL_TREE, + arg), + tf_warning_or_error); } /* Handle ordinary C++ destructors. */ type = TREE_TYPE (decl); @@ -12224,7 +12229,7 @@ cxx_maybe_build_cleanup (tree decl) call = build_delete (TREE_TYPE (addr), addr, sfk_complete_destructor, flags, 0); if (cleanup) - cleanup = build_compound_expr (cleanup, call); + cleanup = build_compound_expr (cleanup, call, tf_warning_or_error); else cleanup = call; } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 367d9eba26b..078ca99e6f8 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -311,7 +311,7 @@ grok_array_decl (tree array_expr, tree index_exp) if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))) expr = build_new_op (ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp, NULL_TREE, - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, tf_warning_or_error); else { tree p1, p2, i1, i2; @@ -1190,7 +1190,7 @@ build_anon_union_vars (tree type, tree object) DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, - false); + false, tf_warning_or_error); if (DECL_NAME (field)) { @@ -2436,13 +2436,15 @@ get_guard_cond (tree guard) guard_value = integer_one_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); - guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value); + guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value, + tf_warning_or_error); } guard_value = integer_zero_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); - return cp_build_binary_op (EQ_EXPR, guard, guard_value); + return cp_build_binary_op (EQ_EXPR, guard, guard_value, + tf_warning_or_error); } /* Return an expression which sets the GUARD variable, indicating that @@ -2458,7 +2460,8 @@ set_guard (tree guard) guard_init = integer_one_node; if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard))) guard_init = convert (TREE_TYPE (guard), guard_init); - return build_modify_expr (guard, NOP_EXPR, guard_init); + return cp_build_modify_expr (guard, NOP_EXPR, guard_init, + tf_warning_or_error); } /* Start the process of running a particular set of global constructors @@ -2787,17 +2790,21 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp) else if (initp) guard_cond = cp_build_binary_op (EQ_EXPR, - build_unary_op (PREINCREMENT_EXPR, + cp_build_unary_op (PREINCREMENT_EXPR, guard, - /*noconvert=*/1), - integer_one_node); + /*noconvert=*/1, + tf_warning_or_error), + integer_one_node, + tf_warning_or_error); else guard_cond = cp_build_binary_op (EQ_EXPR, - build_unary_op (PREDECREMENT_EXPR, + cp_build_unary_op (PREDECREMENT_EXPR, guard, - /*noconvert=*/1), - integer_zero_node); + /*noconvert=*/1, + tf_warning_or_error), + integer_zero_node, + tf_warning_or_error); guard_if_stmt = begin_if_stmt (); finish_if_stmt_cond (guard_cond, guard_if_stmt); @@ -2849,8 +2856,9 @@ do_static_initialization_or_destruction (tree vars, bool initp) init_if_stmt = begin_if_stmt (); cond = initp ? integer_one_node : integer_zero_node; cond = cp_build_binary_op (EQ_EXPR, - initialize_p_decl, - cond); + initialize_p_decl, + cond, + tf_warning_or_error); finish_if_stmt_cond (cond, init_if_stmt); node = vars; @@ -2882,7 +2890,8 @@ do_static_initialization_or_destruction (tree vars, bool initp) priority_if_stmt = begin_if_stmt (); cond = cp_build_binary_op (EQ_EXPR, priority_decl, - build_int_cst (NULL_TREE, priority)); + build_int_cst (NULL_TREE, priority), + tf_warning_or_error); finish_if_stmt_cond (cond, priority_if_stmt); /* Process initializers with same priority. */ @@ -3031,7 +3040,8 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, arguments = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, constructor_p), arguments); - finish_expr_stmt (build_function_call (fndecl, arguments)); + finish_expr_stmt (cp_build_function_call (fndecl, arguments, + tf_warning_or_error)); } } @@ -3534,7 +3544,7 @@ build_offset_ref_call_from_tree (tree fn, tree args) args = build_non_dependent_args (args); object = build_non_dependent_expr (object); if (TREE_CODE (fn) == DOTSTAR_EXPR) - object = build_unary_op (ADDR_EXPR, object, 0); + object = cp_build_unary_op (ADDR_EXPR, object, 0, tf_warning_or_error); args = tree_cons (NULL_TREE, object, args); /* Now that the arguments are done, transform FN. */ fn = build_non_dependent_expr (fn); @@ -3548,13 +3558,14 @@ build_offset_ref_call_from_tree (tree fn, tree args) void B::g() { (this->*p)(); } */ if (TREE_CODE (fn) == OFFSET_REF) { - tree object_addr = build_unary_op (ADDR_EXPR, object, 0); + tree object_addr = cp_build_unary_op (ADDR_EXPR, object, 0, + tf_warning_or_error); fn = TREE_OPERAND (fn, 1); fn = get_member_function_from_ptrfunc (&object_addr, fn); args = tree_cons (NULL_TREE, object_addr, args); } - expr = build_function_call (fn, args); + expr = cp_build_function_call (fn, args, tf_warning_or_error); if (processing_template_decl && expr != error_mark_node) return build_min_non_dep_call_list (expr, orig_fn, orig_args); return expr; diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 97a17850195..9216a44aad6 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2048,6 +2048,14 @@ dump_expr (tree t, int flags) case CONJ_EXPR: case VECTOR_CST: case FIXED_CST: + case UNORDERED_EXPR: + case ORDERED_EXPR: + case UNLT_EXPR: + case UNLE_EXPR: + case UNGT_EXPR: + case UNGE_EXPR: + case UNEQ_EXPR: + case LTGT_EXPR: pp_expression (cxx_pp, t); break; diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 38111b16338..5304381a499 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -176,8 +176,9 @@ do_get_exception_ptr (void) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), - NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), + NULL_TREE), + tf_warning_or_error); } /* Build up a call to __cxa_begin_catch, to tell the runtime that the @@ -196,8 +197,9 @@ do_begin_catch (void) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), - NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), + NULL_TREE), + tf_warning_or_error); } /* Returns nonzero if cleaning up an exception of type TYPE (which can be @@ -235,7 +237,7 @@ do_end_catch (tree type) TREE_NOTHROW (fn) = 0; } - cleanup = build_function_call (fn, NULL_TREE); + cleanup = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); TREE_NOTHROW (cleanup) = dtor_nothrow (type); return cleanup; @@ -377,7 +379,7 @@ initialize_handler_parm (tree decl, tree exp) pointer catch parm with the address of the temporary. */ if (TREE_CODE (init_type) == REFERENCE_TYPE && TYPE_PTR_P (TREE_TYPE (init_type))) - exp = build_unary_op (ADDR_EXPR, exp, 1); + exp = cp_build_unary_op (ADDR_EXPR, exp, 1, tf_warning_or_error); exp = ocp_convert (init_type, exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); @@ -434,7 +436,7 @@ expand_start_catch_block (tree decl) exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp, fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (TREE_TYPE (exp)))); - exp = build_indirect_ref (exp, NULL); + exp = cp_build_indirect_ref (exp, NULL, tf_warning_or_error); initialize_handler_parm (decl, exp); return type; } @@ -546,8 +548,10 @@ do_allocate_exception (tree type) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type), - NULL_TREE)); + return cp_build_function_call (fn, + tree_cons (NULL_TREE, size_in_bytes (type), + NULL_TREE), + tf_warning_or_error); } /* Call __cxa_free_exception from a cleanup. This is never invoked @@ -566,7 +570,8 @@ do_free_exception (tree ptr) void_list_node)); } - return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE), + tf_warning_or_error); } /* Wrap all cleanups for TARGET_EXPRs in MUST_NOT_THROW_EXPR. @@ -644,7 +649,8 @@ build_throw (tree exp) return error_mark_node; } fn = OVL_CURRENT (fn); - exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE)); + exp = cp_build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE), + tf_warning_or_error); } else if (exp) { @@ -708,7 +714,7 @@ build_throw (tree exp) allocate_expr = get_target_expr (allocate_expr); ptr = TARGET_EXPR_SLOT (allocate_expr); object = build_nop (build_pointer_type (temp_type), ptr); - object = build_indirect_ref (object, NULL); + object = cp_build_indirect_ref (object, NULL, tf_warning_or_error); elided = (TREE_CODE (exp) == TARGET_EXPR); @@ -733,7 +739,7 @@ build_throw (tree exp) (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - flags)); + flags, tf_warning_or_error)); if (exp == error_mark_node) { error (" in thrown expression"); @@ -812,7 +818,7 @@ build_throw (tree exp) tmp = tree_cons (NULL_TREE, throw_type, tmp); tmp = tree_cons (NULL_TREE, ptr, tmp); /* ??? Indicate that this function call throws throw_type. */ - tmp = build_function_call (fn, tmp); + tmp = cp_build_function_call (fn, tmp, tf_warning_or_error); /* Tack on the initialization stuff. */ exp = build2 (COMPOUND_EXPR, TREE_TYPE (tmp), exp, tmp); @@ -831,7 +837,7 @@ build_throw (tree exp) /* ??? Indicate that this function call allows exceptions of the type of the enclosing catch block (if known). */ - exp = build_function_call (fn, NULL_TREE); + exp = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); } exp = build1 (THROW_EXPR, void_type_node, exp); diff --git a/gcc/cp/init.c b/gcc/cp/init.c index e0700eacb4f..dc4e988a3ee 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -39,8 +39,8 @@ along with GCC; see the file COPYING3. If not see static bool begin_init_stmts (tree *, tree *); static tree finish_init_stmts (bool, tree, tree); static void construct_virtual_base (tree, tree); -static void expand_aggr_init_1 (tree, tree, tree, tree, int); -static void expand_default_init (tree, tree, tree, tree, int); +static void expand_aggr_init_1 (tree, tree, tree, tree, int, tsubst_flags_t); +static void expand_default_init (tree, tree, tree, tree, int, tsubst_flags_t); static tree build_vec_delete_1 (tree, tree, tree, special_function_kind, int); static void perform_member_init (tree, tree); static tree build_builtin_delete_call (tree); @@ -353,7 +353,8 @@ build_value_init_1 (tree type, bool have_ctor) return build_cplus_new (type, build_special_member_call (NULL_TREE, complete_ctor_identifier, - NULL_TREE, type, LOOKUP_NORMAL)); + NULL_TREE, type, LOOKUP_NORMAL, + tf_warning_or_error)); else if (TREE_CODE (type) != UNION_TYPE) { tree field, init; @@ -401,7 +402,7 @@ build_value_init_1 (tree type, bool have_ctor) cp_gimplify_init_expr will know how to handle it. */ tree ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, - NULL_TREE, type, LOOKUP_NORMAL); + NULL_TREE, type, LOOKUP_NORMAL, tf_warning_or_error); ctor = build_cplus_new (type, ctor); init = build2 (INIT_EXPR, void_type_node, @@ -487,7 +488,8 @@ perform_member_init (tree member, tree init) /* Get an lvalue for the data member. */ decl = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, - /*preserve_reference=*/true); + /*preserve_reference=*/true, + tf_warning_or_error); if (decl == error_mark_node) return; @@ -513,10 +515,12 @@ perform_member_init (tree member, tree init) /* Initialization of one array from another. */ finish_expr_stmt (build_vec_init (decl, NULL_TREE, TREE_VALUE (init), /*explicit_default_init_p=*/false, - /* from_array=*/1)); + /* from_array=*/1, + tf_warning_or_error)); } else - finish_expr_stmt (build_aggr_init (decl, init, 0)); + finish_expr_stmt (build_aggr_init (decl, init, 0, + tf_warning_or_error)); } else { @@ -544,7 +548,8 @@ perform_member_init (tree member, tree init) init = build_x_compound_expr_from_list (init, "member initializer"); if (init) - finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init)); + finish_expr_stmt (cp_build_modify_expr (decl, INIT_EXPR, init, + tf_warning_or_error)); } if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) @@ -553,7 +558,8 @@ perform_member_init (tree member, tree init) expr = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, - /*preserve_reference=*/false); + /*preserve_reference=*/false, + tf_warning_or_error); expr = build_delete (type, expr, sfk_complete_destructor, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0); @@ -855,9 +861,11 @@ emit_mem_initializers (tree mem_inits) base_addr = build_base_path (PLUS_EXPR, current_class_ptr, subobject, 1); expand_aggr_init_1 (subobject, NULL_TREE, - build_indirect_ref (base_addr, NULL), + cp_build_indirect_ref (base_addr, NULL, + tf_warning_or_error), arguments, - LOOKUP_NORMAL); + LOOKUP_NORMAL, + tf_warning_or_error); expand_cleanup_for_base (subobject, NULL_TREE); } @@ -938,7 +946,7 @@ expand_virtual_init (tree binfo, tree decl) TREE_TYPE (vtt_parm), vtt_parm, vtt_index); - vtbl2 = build_indirect_ref (vtbl2, NULL); + vtbl2 = cp_build_indirect_ref (vtbl2, NULL, tf_warning_or_error); vtbl2 = convert (TREE_TYPE (vtbl), vtbl2); /* The actual initializer is the VTT value only in the subobject @@ -953,13 +961,15 @@ expand_virtual_init (tree binfo, tree decl) } /* Compute the location of the vtpr. */ - vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL), + vtbl_ptr = build_vfield_ref (cp_build_indirect_ref (decl, NULL, + tf_warning_or_error), TREE_TYPE (binfo)); gcc_assert (vtbl_ptr != error_mark_node); /* Assign the vtable to the vptr. */ vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0); - finish_expr_stmt (build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl)); + finish_expr_stmt (cp_build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl, + tf_warning_or_error)); } /* If an exception is thrown in a constructor, those base classes already @@ -981,7 +991,8 @@ expand_cleanup_for_base (tree binfo, tree flag) base_dtor_identifier, NULL_TREE, binfo, - LOOKUP_NORMAL | LOOKUP_NONVIRTUAL); + LOOKUP_NORMAL | LOOKUP_NONVIRTUAL, + tf_warning_or_error); if (flag) expr = fold_build3 (COND_EXPR, void_type_node, c_common_truthvalue_conversion (flag), @@ -1025,7 +1036,7 @@ construct_virtual_base (tree vbase, tree arguments) exp = convert_to_base_statically (current_class_ref, vbase); expand_aggr_init_1 (vbase, current_class_ref, exp, arguments, - LOOKUP_COMPLAIN); + LOOKUP_COMPLAIN, tf_warning_or_error); finish_then_clause (inner_if_stmt); finish_if_stmt (inner_if_stmt); @@ -1230,7 +1241,7 @@ expand_member_init (tree name) perform the initialization, but not both, as it would be ambiguous. */ tree -build_aggr_init (tree exp, tree init, int flags) +build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain) { tree stmt_expr; tree compound_stmt; @@ -1257,7 +1268,8 @@ build_aggr_init (tree exp, tree init, int flags) initialization form -- unless the initializer is "()". */ if (init && TREE_CODE (init) == TREE_LIST) { - error ("bad array initializer"); + if (complain & tf_error) + error ("bad array initializer"); return error_mark_node; } /* Must arrange to initialize each element of EXP @@ -1270,7 +1282,8 @@ build_aggr_init (tree exp, tree init, int flags) stmt_expr = build_vec_init (exp, NULL_TREE, init, /*explicit_default_init_p=*/false, itype && same_type_p (itype, - TREE_TYPE (exp))); + TREE_TYPE (exp)), + complain); TREE_READONLY (exp) = was_const; TREE_THIS_VOLATILE (exp) = was_volatile; TREE_TYPE (exp) = type; @@ -1287,7 +1300,7 @@ build_aggr_init (tree exp, tree init, int flags) destroy_temps = stmts_are_full_exprs_p (); current_stmt_tree ()->stmts_are_full_exprs_p = 0; expand_aggr_init_1 (TYPE_BINFO (type), exp, exp, - init, LOOKUP_NORMAL|flags); + init, LOOKUP_NORMAL|flags, complain); stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt); current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; TREE_READONLY (exp) = was_const; @@ -1297,7 +1310,8 @@ build_aggr_init (tree exp, tree init, int flags) } static void -expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) +expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags, + tsubst_flags_t complain) { tree type = TREE_TYPE (exp); tree ctor_name; @@ -1364,9 +1378,10 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) else ctor_name = base_ctor_identifier; - rval = build_special_member_call (exp, ctor_name, parms, binfo, flags); + rval = build_special_member_call (exp, ctor_name, parms, binfo, flags, + complain); if (TREE_SIDE_EFFECTS (rval)) - finish_expr_stmt (convert_to_void (rval, NULL)); + finish_expr_stmt (convert_to_void (rval, NULL, complain)); } /* This function is responsible for initializing EXP with INIT @@ -1390,7 +1405,8 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) for its description. */ static void -expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags) +expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags, + tsubst_flags_t complain) { tree type = TREE_TYPE (exp); @@ -1417,7 +1433,7 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags) /* We know that expand_default_init can handle everything we want at this point. */ - expand_default_init (binfo, true_exp, exp, init, flags); + expand_default_init (binfo, true_exp, exp, init, flags, complain); } /* Report an error if TYPE is not a user-defined, class type. If @@ -1574,7 +1590,8 @@ build_offset_ref (tree type, tree member, bool address_p) if (flag_ms_extensions) { PTRMEM_OK_P (member) = 1; - return build_unary_op (ADDR_EXPR, member, 0); + return cp_build_unary_op (ADDR_EXPR, member, 0, + tf_warning_or_error); } error ("invalid use of non-static member function %qD", TREE_OPERAND (member, 1)); @@ -1765,7 +1782,7 @@ avoid_placement_new_aliasing (tree t, tree placement) static tree build_new_1 (tree placement, tree type, tree nelts, tree init, - bool globally_qualified_p) + bool globally_qualified_p, tsubst_flags_t complain) { tree size, rval; /* True iff this is a call to "operator new[]" instead of just @@ -1855,11 +1872,13 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, TREE_CODE (elt_type) == ARRAY_TYPE; elt_type = TREE_TYPE (elt_type)) nelts = cp_build_binary_op (MULT_EXPR, nelts, - array_type_nelts_top (elt_type)); + array_type_nelts_top (elt_type), + complain); if (TREE_CODE (elt_type) == VOID_TYPE) { - error ("invalid type %<void%> for new"); + if (complain & tf_error) + error ("invalid type %<void%> for new"); return error_mark_node; } @@ -1869,7 +1888,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || init); if (CP_TYPE_CONST_P (elt_type) && !is_initialized) { - error ("uninitialized const in %<new%> of %q#T", elt_type); + if (complain & tf_error) + error ("uninitialized const in %<new%> of %q#T", elt_type); return error_mark_node; } @@ -1907,19 +1927,22 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, if (!get_global_value_if_present (get_identifier (alloc_name), &alloc_fn)) { - error ("call to Java constructor with %qs undefined", alloc_name); + if (complain & tf_error) + error ("call to Java constructor with %qs undefined", alloc_name); return error_mark_node; } else if (really_overloaded_fn (alloc_fn)) { - error ("%qD should never be overloaded", alloc_fn); + if (complain & tf_error) + error ("%qD should never be overloaded", alloc_fn); return error_mark_node; } alloc_fn = OVL_CURRENT (alloc_fn); class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); - alloc_call = (build_function_call + alloc_call = (cp_build_function_call (alloc_fn, - build_tree_list (NULL_TREE, class_addr))); + build_tree_list (NULL_TREE, class_addr), + complain)); } else if (TYPE_FOR_JAVA (elt_type) && MAYBE_CLASS_TYPE_P (elt_type)) { @@ -1952,20 +1975,25 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, fns = lookup_fnfields (elt_type, fnname, /*protect=*/2); if (fns == NULL_TREE) { - error ("no suitable %qD found in class %qT", fnname, elt_type); + if (complain & tf_error) + error ("no suitable %qD found in class %qT", fnname, elt_type); return error_mark_node; } if (TREE_CODE (fns) == TREE_LIST) { - error ("request for member %qD is ambiguous", fnname); - print_candidates (fns); + if (complain & tf_error) + { + error ("request for member %qD is ambiguous", fnname); + print_candidates (fns); + } return error_mark_node; } alloc_call = build_new_method_call (build_dummy_object (elt_type), fns, args, /*conversion_path=*/NULL_TREE, LOOKUP_NORMAL, - &alloc_fn); + &alloc_fn, + complain); } else { @@ -2085,7 +2113,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, size_ptr_type = build_pointer_type (sizetype); cookie_ptr = build2 (POINTER_PLUS_EXPR, size_ptr_type, fold_convert (size_ptr_type, data_addr), cookie_ptr); - cookie = build_indirect_ref (cookie_ptr, NULL); + cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain); cookie_expr = build2 (MODIFY_EXPR, sizetype, cookie, nelts); @@ -2096,7 +2124,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, fold_build1 (NEGATE_EXPR, sizetype, size_in_bytes (sizetype))); - cookie = build_indirect_ref (cookie_ptr, NULL); + cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain); cookie = build2 (MODIFY_EXPR, sizetype, cookie, size_in_bytes(elt_type)); cookie_expr = build2 (COMPOUND_EXPR, TREE_TYPE (cookie_expr), @@ -2119,7 +2147,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, { bool stable; - init_expr = build_indirect_ref (data_addr, NULL); + init_expr = cp_build_indirect_ref (data_addr, NULL, complain); if (array_p) { @@ -2131,15 +2159,21 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, explicit_default_init_p = true; } else if (init) - pedwarn ("ISO C++ forbids initialization in array new"); - + { + if (complain & tf_error) + pedwarn ("ISO C++ forbids initialization in array new"); + else + return error_mark_node; + } init_expr = build_vec_init (init_expr, cp_build_binary_op (MINUS_EXPR, outer_nelts, - integer_one_node), + integer_one_node, + complain), init, explicit_default_init_p, - /*from_array=*/0); + /*from_array=*/0, + complain); /* An array initialization is stable because the initialization of each element is a full-expression, so the temporaries don't @@ -2156,7 +2190,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, init_expr = build_special_member_call (init_expr, complete_ctor_identifier, init, elt_type, - LOOKUP_NORMAL); + LOOKUP_NORMAL, + complain); stable = stabilize_init (init_expr, &init_preeval_expr); } else @@ -2171,7 +2206,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, gcc_assert (TREE_CODE (init) != CONSTRUCTOR || TREE_TYPE (init) != NULL_TREE); - init_expr = build_modify_expr (init_expr, INIT_EXPR, init); + init_expr = cp_build_modify_expr (init_expr, INIT_EXPR, init, + complain); stable = stabilize_init (init_expr, &init_preeval_expr); } } @@ -2263,8 +2299,10 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, if (check_new) { tree ifexp = cp_build_binary_op (NE_EXPR, alloc_node, - integer_zero_node); - rval = build_conditional_expr (ifexp, rval, alloc_node); + integer_zero_node, + complain); + rval = build_conditional_expr (ifexp, rval, alloc_node, + complain); } /* Perform the allocation before anything else, so that ALLOC_NODE @@ -2299,7 +2337,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, tree build_new (tree placement, tree type, tree nelts, tree init, - int use_global_new) + int use_global_new, tsubst_flags_t complain) { tree rval; tree orig_placement; @@ -2333,7 +2371,12 @@ build_new (tree placement, tree type, tree nelts, tree init, if (nelts) { if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, nelts, false)) - pedwarn ("size in array new must have integral type"); + { + if (complain & tf_error) + pedwarn ("size in array new must have integral type"); + else + return error_mark_node; + } nelts = cp_save_expr (cp_convert (sizetype, nelts)); } @@ -2342,13 +2385,17 @@ build_new (tree placement, tree type, tree nelts, tree init, returned by new.'' ARM 5.3.3 */ if (TREE_CODE (type) == REFERENCE_TYPE) { - error ("new cannot be applied to a reference type"); + if (complain & tf_error) + error ("new cannot be applied to a reference type"); + else + return error_mark_node; type = TREE_TYPE (type); } if (TREE_CODE (type) == FUNCTION_TYPE) { - error ("new cannot be applied to a function type"); + if (complain & tf_error) + error ("new cannot be applied to a function type"); return error_mark_node; } @@ -2358,7 +2405,7 @@ build_new (tree placement, tree type, tree nelts, tree init, if (!complete_type_or_else (type, NULL_TREE)) return error_mark_node; - rval = build_new_1 (placement, type, nelts, init, use_global_new); + rval = build_new_1 (placement, type, nelts, init, use_global_new, complain); if (rval == error_mark_node) return error_mark_node; @@ -2464,10 +2511,11 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, convert (sizetype, maxindex)); tbase = create_temporary_var (ptype); - tbase_init = build_modify_expr (tbase, NOP_EXPR, - fold_build2 (POINTER_PLUS_EXPR, ptype, - fold_convert (ptype, base), - virtual_size)); + tbase_init = cp_build_modify_expr (tbase, NOP_EXPR, + fold_build2 (POINTER_PLUS_EXPR, ptype, + fold_convert (ptype, base), + virtual_size), + tf_warning_or_error); DECL_REGISTER (tbase) = 1; controller = build3 (BIND_EXPR, void_type_node, tbase, NULL_TREE, NULL_TREE); @@ -2478,14 +2526,17 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, fold_convert (ptype, base))); tmp = fold_build1 (NEGATE_EXPR, sizetype, size_exp); body = build_compound_expr - (body, build_modify_expr (tbase, NOP_EXPR, - build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp))); + (body, cp_build_modify_expr (tbase, NOP_EXPR, + build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp), + tf_warning_or_error), + tf_warning_or_error); body = build_compound_expr (body, build_delete (ptype, tbase, sfk_complete_destructor, - LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1)); + LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1), + tf_warning_or_error); loop = build1 (LOOP_EXPR, void_type_node, body); - loop = build_compound_expr (tbase_init, loop); + loop = build_compound_expr (tbase_init, loop, tf_warning_or_error); no_destructor: /* If the delete flag is one, or anything else with the low bit set, @@ -2511,7 +2562,8 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, cp_build_binary_op (MINUS_EXPR, cp_convert (string_type_node, base), - cookie_size)); + cookie_size, + tf_warning_or_error)); /* True size with header. */ virtual_size = size_binop (PLUS_EXPR, virtual_size, cookie_size); } @@ -2530,7 +2582,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, else if (!body) body = deallocate_expr; else - body = build_compound_expr (body, deallocate_expr); + body = build_compound_expr (body, deallocate_expr, tf_warning_or_error); if (!body) body = integer_zero_node; @@ -2553,7 +2605,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, /* Pre-evaluate the SAVE_EXPR outside of the BIND_EXPR. */ body = build2 (COMPOUND_EXPR, void_type_node, base, body); - return convert_to_void (body, /*implicit=*/NULL); + return convert_to_void (body, /*implicit=*/NULL, tf_warning_or_error); } /* Create an unnamed variable of the indicated TYPE. */ @@ -2588,7 +2640,8 @@ get_temp_regvar (tree type, tree init) decl = create_temporary_var (type); add_decl_expr (decl); - finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init)); + finish_expr_stmt (cp_build_modify_expr (decl, INIT_EXPR, init, + tf_warning_or_error)); return decl; } @@ -2616,7 +2669,7 @@ get_temp_regvar (tree type, tree init) tree build_vec_init (tree base, tree maxindex, tree init, bool explicit_default_init_p, - int from_array) + int from_array, tsubst_flags_t complain) { tree rval; tree base2 = NULL_TREE; @@ -2737,14 +2790,16 @@ build_vec_init (tree base, tree maxindex, tree init, current_stmt_tree ()->stmts_are_full_exprs_p = 1; if (MAYBE_CLASS_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE) - finish_expr_stmt (build_aggr_init (baseref, elt, 0)); + finish_expr_stmt (build_aggr_init (baseref, elt, 0, complain)); else - finish_expr_stmt (build_modify_expr (baseref, NOP_EXPR, - elt)); + finish_expr_stmt (cp_build_modify_expr (baseref, NOP_EXPR, + elt, complain)); current_stmt_tree ()->stmts_are_full_exprs_p = 0; - finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0)); - finish_expr_stmt (build_unary_op (PREDECREMENT_EXPR, iterator, 0)); + finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, 0, + complain)); + finish_expr_stmt (cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, + complain)); } /* Clear out INIT so that we don't get confused below. */ @@ -2766,7 +2821,8 @@ build_vec_init (tree base, tree maxindex, tree init, && TYPE_NEEDS_CONSTRUCTING (type) && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) { - error ("initializer ends prematurely"); + if (complain & tf_error) + error ("initializer ends prematurely"); return error_mark_node; } } @@ -2794,7 +2850,8 @@ build_vec_init (tree base, tree maxindex, tree init, finish_for_cond (build2 (NE_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), for_stmt); - finish_for_expr (build_unary_op (PREDECREMENT_EXPR, iterator, 0), + finish_for_expr (cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, + complain), for_stmt); to = build1 (INDIRECT_REF, type, base); @@ -2809,11 +2866,13 @@ build_vec_init (tree base, tree maxindex, tree init, from = NULL_TREE; if (from_array == 2) - elt_init = build_modify_expr (to, NOP_EXPR, from); + elt_init = cp_build_modify_expr (to, NOP_EXPR, from, + complain); else if (TYPE_NEEDS_CONSTRUCTING (type)) - elt_init = build_aggr_init (to, from, 0); + elt_init = build_aggr_init (to, from, 0, complain); else if (from) - elt_init = build_modify_expr (to, NOP_EXPR, from); + elt_init = cp_build_modify_expr (to, NOP_EXPR, from, + complain); else gcc_unreachable (); } @@ -2825,23 +2884,26 @@ build_vec_init (tree base, tree maxindex, tree init, elt_init = build_vec_init (build1 (INDIRECT_REF, type, base), 0, 0, /*explicit_default_init_p=*/false, - 0); + 0, complain); } else if (!TYPE_NEEDS_CONSTRUCTING (type)) - elt_init = (build_modify_expr + elt_init = (cp_build_modify_expr (to, INIT_EXPR, build_zero_init (type, size_one_node, - /*static_storage_p=*/false))); + /*static_storage_p=*/false), + complain)); else - elt_init = build_aggr_init (to, init, 0); + elt_init = build_aggr_init (to, init, 0, complain); current_stmt_tree ()->stmts_are_full_exprs_p = 1; finish_expr_stmt (elt_init); current_stmt_tree ()->stmts_are_full_exprs_p = 0; - finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0)); + finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, 0, + complain)); if (base2) - finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base2, 0)); + finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base2, 0, + complain)); finish_for_stmt (for_stmt); } @@ -2851,13 +2913,15 @@ build_vec_init (tree base, tree maxindex, tree init, && from_array != 2) { tree e; - tree m = cp_build_binary_op (MINUS_EXPR, maxindex, iterator); + tree m = cp_build_binary_op (MINUS_EXPR, maxindex, iterator, + complain); /* Flatten multi-dimensional array since build_vec_delete only expects one-dimensional array. */ if (TREE_CODE (type) == ARRAY_TYPE) m = cp_build_binary_op (MULT_EXPR, m, - array_type_nelts_total (type)); + array_type_nelts_total (type), + complain); finish_cleanup_try_block (try_block); e = build_vec_delete_1 (rval, m, @@ -2875,7 +2939,7 @@ build_vec_init (tree base, tree maxindex, tree init, /* Now convert make the result have the correct type. */ atype = build_pointer_type (atype); stmt_expr = build1 (NOP_EXPR, atype, stmt_expr); - stmt_expr = build_indirect_ref (stmt_expr, NULL); + stmt_expr = cp_build_indirect_ref (stmt_expr, NULL, complain); current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; return stmt_expr; @@ -2911,7 +2975,8 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags) /*args=*/NULL_TREE, /*conversion_path=*/NULL_TREE, flags, - /*fn_p=*/NULL); + /*fn_p=*/NULL, + tf_warning_or_error); } /* Generate a call to a destructor. TYPE is the type to cast ADDR to. @@ -2993,7 +3058,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, /* Don't check PROTECT here; leave that decision to the destructor. If the destructor is accessible, call it, else report error. */ - addr = build_unary_op (ADDR_EXPR, addr, 0); + addr = cp_build_unary_op (ADDR_EXPR, addr, 0, tf_warning_or_error); if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); @@ -3065,7 +3130,8 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, /*alloc_fn=*/NULL_TREE); } - expr = build_dtor_call (build_indirect_ref (addr, NULL), + expr = build_dtor_call (cp_build_indirect_ref (addr, NULL, + tf_warning_or_error), auto_delete, flags); if (do_delete) expr = build2 (COMPOUND_EXPR, void_type_node, expr, do_delete); @@ -3079,7 +3145,8 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, ifexp = integer_one_node; else /* Handle deleting a null pointer. */ - ifexp = fold (cp_build_binary_op (NE_EXPR, addr, integer_zero_node)); + ifexp = fold (cp_build_binary_op (NE_EXPR, addr, integer_zero_node, + tf_warning_or_error)); if (ifexp != integer_one_node) expr = build3 (COND_EXPR, void_type_node, @@ -3123,7 +3190,8 @@ push_base_cleanups (void) NULL_TREE, base_binfo, (LOOKUP_NORMAL - | LOOKUP_NONVIRTUAL)); + | LOOKUP_NONVIRTUAL), + tf_warning_or_error); expr = build3 (COND_EXPR, void_type_node, cond, expr, void_zero_node); finish_decl_cleanup (NULL_TREE, expr); @@ -3142,7 +3210,8 @@ push_base_cleanups (void) expr = build_special_member_call (current_class_ref, base_dtor_identifier, NULL_TREE, base_binfo, - LOOKUP_NORMAL | LOOKUP_NONVIRTUAL); + LOOKUP_NORMAL | LOOKUP_NONVIRTUAL, + tf_warning_or_error); finish_decl_cleanup (NULL_TREE, expr); } @@ -3158,7 +3227,8 @@ push_base_cleanups (void) tree this_member = (build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, - /*preserve_reference=*/false)); + /*preserve_reference=*/false, + tf_warning_or_error)); tree this_type = TREE_TYPE (member); expr = build_delete (this_type, this_member, sfk_complete_destructor, @@ -3211,7 +3281,7 @@ build_vec_delete (tree base, tree maxindex, build_pointer_type (sizetype), base, cookie_addr); - maxindex = build_indirect_ref (cookie_addr, NULL); + maxindex = cp_build_indirect_ref (cookie_addr, NULL, tf_warning_or_error); } else if (TREE_CODE (type) == ARRAY_TYPE) { @@ -3219,7 +3289,7 @@ build_vec_delete (tree base, tree maxindex, bad name. */ maxindex = array_type_nelts_total (type); type = strip_array_types (type); - base = build_unary_op (ADDR_EXPR, base, 1); + base = cp_build_unary_op (ADDR_EXPR, base, 1, tf_warning_or_error); if (TREE_SIDE_EFFECTS (base)) { base_init = get_target_expr (base); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index c8061bbc6b8..5d50f8542f9 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -674,7 +674,8 @@ do_build_assign_ref (tree fndecl) build_tree_list (NULL_TREE, converted_parm), base_binfo, - LOOKUP_NORMAL | LOOKUP_NONVIRTUAL)); + LOOKUP_NORMAL | LOOKUP_NONVIRTUAL, + tf_warning_or_error)); } /* Assign to each of the non-static data members. */ @@ -729,7 +730,8 @@ do_build_assign_ref (tree fndecl) init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE); if (DECL_NAME (field)) - init = build_modify_expr (comp, NOP_EXPR, init); + init = cp_build_modify_expr (comp, NOP_EXPR, init, + tf_warning_or_error); else init = build2 (MODIFY_EXPR, TREE_TYPE (comp), comp, init); finish_expr_stmt (init); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8156822f626..8a9c3e29563 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -4333,19 +4333,20 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, { case RID_DYNCAST: postfix_expression - = build_dynamic_cast (type, expression); + = build_dynamic_cast (type, expression, tf_warning_or_error); break; case RID_STATCAST: postfix_expression - = build_static_cast (type, expression); + = build_static_cast (type, expression, tf_warning_or_error); break; case RID_REINTCAST: postfix_expression - = build_reinterpret_cast (type, expression); + = build_reinterpret_cast (type, expression, + tf_warning_or_error); break; case RID_CONSTCAST: postfix_expression - = build_const_cast (type, expression); + = build_const_cast (type, expression, tf_warning_or_error); break; default: gcc_unreachable (); @@ -4644,12 +4645,14 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, (instance, fn, args, NULL_TREE, (idk == CP_ID_KIND_QUALIFIED ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL), - /*fn_p=*/NULL)); + /*fn_p=*/NULL, + tf_warning_or_error)); else postfix_expression = finish_call_expr (postfix_expression, args, /*disallow_virtual=*/false, - /*koenig_p=*/false); + /*koenig_p=*/false, + tf_warning_or_error); } else if (TREE_CODE (postfix_expression) == OFFSET_REF || TREE_CODE (postfix_expression) == MEMBER_REF @@ -4662,13 +4665,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, postfix_expression = finish_call_expr (postfix_expression, args, /*disallow_virtual=*/true, - koenig_p); + koenig_p, + tf_warning_or_error); else /* All other function calls. */ postfix_expression = finish_call_expr (postfix_expression, args, /*disallow_virtual=*/false, - koenig_p); + koenig_p, + tf_warning_or_error); /* The POSTFIX_EXPRESSION is certainly no longer an id. */ idk = CP_ID_KIND_NONE; @@ -4937,7 +4942,8 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, (name, BINFO_TYPE (BASELINK_ACCESS_BINFO (name)), scope); postfix_expression = finish_class_member_access_expr (postfix_expression, name, - template_p); + template_p, + tf_warning_or_error); } } @@ -5250,7 +5256,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p) if (TYPE_P (operand)) return cxx_sizeof_or_alignof_type (operand, op, true); else - return cxx_sizeof_or_alignof_expr (operand, op); + return cxx_sizeof_or_alignof_expr (operand, op, true); } case RID_NEW: @@ -5287,7 +5293,8 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p) /* Create the complete representation. */ return build_x_unary_op ((keyword == RID_REALPART ? REALPART_EXPR : IMAGPART_EXPR), - expression); + expression, + tf_warning_or_error); } break; @@ -5362,14 +5369,16 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p) { case INDIRECT_REF: non_constant_p = "`*'"; - expression = build_x_indirect_ref (cast_expression, "unary *"); + expression = build_x_indirect_ref (cast_expression, "unary *", + tf_warning_or_error); break; case ADDR_EXPR: non_constant_p = "`&'"; /* Fall through. */ case BIT_NOT_EXPR: - expression = build_x_unary_op (unary_operator, cast_expression); + expression = build_x_unary_op (unary_operator, cast_expression, + tf_warning_or_error); break; case PREINCREMENT_EXPR: @@ -5500,7 +5509,8 @@ cp_parser_new_expression (cp_parser* parser) return error_mark_node; /* Create a representation of the new-expression. */ - return build_new (placement, type, nelts, initializer, global_scope_p); + return build_new (placement, type, nelts, initializer, global_scope_p, + tf_warning_or_error); } /* Parse a new-placement. @@ -5870,7 +5880,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p) return error_mark_node; /* Perform the cast. */ - expr = build_c_cast (type, expr); + expr = build_c_cast (type, expr, tf_warning_or_error); return expr; } } @@ -6059,7 +6069,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p) overloaded_p = false; lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, - &overloaded_p); + &overloaded_p, tf_warning_or_error); lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, @@ -6115,7 +6125,8 @@ cp_parser_question_colon_clause (cp_parser* parser, tree logical_or_expr) /* Build the conditional-expression. */ return build_x_conditional_expr (logical_or_expr, expr, - assignment_expr); + assignment_expr, + tf_warning_or_error); } /* Parse an assignment-expression. @@ -6170,7 +6181,8 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p) /* Build the assignment expression. */ expr = build_x_modify_expr (expr, assignment_operator, - rhs); + rhs, + tf_warning_or_error); } } } @@ -6290,7 +6302,8 @@ cp_parser_expression (cp_parser* parser, bool cast_p) expression = assignment_expression; else expression = build_x_compound_expr (expression, - assignment_expression); + assignment_expression, + tf_warning_or_error); /* If the next token is not a comma, then we are done with the expression. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA)) @@ -6410,7 +6423,8 @@ cp_parser_builtin_offsetof (cp_parser *parser) cp_parser_require (parser, CPP_COMMA, "`,'"); /* Build the (type *)null that begins the traditional offsetof macro. */ - expr = build_static_cast (build_pointer_type (type), null_pointer_node); + expr = build_static_cast (build_pointer_type (type), null_pointer_node, + tf_warning_or_error); /* Parse the offsetof-member-designator. We begin as if we saw "expr->". */ expr = cp_parser_postfix_dot_deref_expression (parser, CPP_DEREF, expr, @@ -10320,7 +10334,8 @@ cp_parser_template_argument (cp_parser* parser) if (cp_parser_parse_definitely (parser)) { if (address_p) - argument = build_x_unary_op (ADDR_EXPR, argument); + argument = build_x_unary_op (ADDR_EXPR, argument, + tf_warning_or_error); return argument; } } @@ -17181,7 +17196,8 @@ cp_parser_functional_cast (cp_parser* parser, tree type) /*allow_expansion_p=*/true, /*non_constant_p=*/NULL); - cast = build_functional_cast (type, expression_list); + cast = build_functional_cast (type, expression_list, + tf_warning_or_error); /* [expr.const]/1: In an integral constant expression "only type conversions to integral or enumeration type can be used". */ if (TREE_CODE (type) == TYPE_DECL) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 628a445a58e..67d392da456 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4630,6 +4630,77 @@ convert_nontype_argument (tree type, tree expr) return expr; } +/* Subroutine of coerce_template_template_parms, which returns 1 if + PARM_PARM and ARG_PARM match using the rule for the template + parameters of template template parameters. Both PARM and ARG are + template parameters; the rest of the arguments are the same as for + coerce_template_template_parms. + */ +static int +coerce_template_template_parm (tree parm, + tree arg, + tsubst_flags_t complain, + tree in_decl, + tree outer_args) +{ + if (arg == NULL_TREE || arg == error_mark_node + || parm == NULL_TREE || parm == error_mark_node) + return 0; + + if (TREE_CODE (arg) != TREE_CODE (parm)) + return 0; + + switch (TREE_CODE (parm)) + { + case TEMPLATE_DECL: + /* We encounter instantiations of templates like + template <template <template <class> class> class TT> + class C; */ + { + tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm); + tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg); + + if (!coerce_template_template_parms + (parmparm, argparm, complain, in_decl, outer_args)) + return 0; + } + /* Fall through. */ + + case TYPE_DECL: + if (TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (arg)) + && !TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (parm))) + /* Argument is a parameter pack but parameter is not. */ + return 0; + break; + + case PARM_DECL: + /* The tsubst call is used to handle cases such as + + template <int> class C {}; + template <class T, template <T> class TT> class D {}; + D<int, C> d; + + i.e. the parameter list of TT depends on earlier parameters. */ + if (!dependent_type_p (TREE_TYPE (arg)) + && !same_type_p + (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl), + TREE_TYPE (arg))) + return 0; + + if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (arg)) + && !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))) + /* Argument is a parameter pack but parameter is not. */ + return 0; + + break; + + default: + gcc_unreachable (); + } + + return 1; +} + /* Return 1 if PARM_PARMS and ARG_PARMS matches using rule for template template parameters. Both PARM_PARMS and ARG_PARMS are @@ -4652,6 +4723,7 @@ coerce_template_template_parms (tree parm_parms, { int nparms, nargs, i; tree parm, arg; + int variadic_p = 0; gcc_assert (TREE_CODE (parm_parms) == TREE_VEC); gcc_assert (TREE_CODE (arg_parms) == TREE_VEC); @@ -4659,10 +4731,37 @@ coerce_template_template_parms (tree parm_parms, nparms = TREE_VEC_LENGTH (parm_parms); nargs = TREE_VEC_LENGTH (arg_parms); - if (nargs != nparms) + /* Determine whether we have a parameter pack at the end of the + template template parameter's template parameter list. */ + if (TREE_VEC_ELT (parm_parms, nparms - 1) != error_mark_node) + { + parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1)); + + switch (TREE_CODE (parm)) + { + case TEMPLATE_DECL: + case TYPE_DECL: + if (TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (parm))) + variadic_p = 1; + break; + + case PARM_DECL: + if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))) + variadic_p = 1; + break; + + default: + gcc_unreachable (); + } + } + + if (nargs != nparms + && !(variadic_p && nargs >= nparms - 1)) return 0; - for (i = 0; i < nparms; ++i) + /* Check all of the template parameters except the parameter pack at + the end (if any). */ + for (i = 0; i < nparms - variadic_p; ++i) { if (TREE_VEC_ELT (parm_parms, i) == error_mark_node || TREE_VEC_ELT (arg_parms, i) == error_mark_node) @@ -4671,60 +4770,35 @@ coerce_template_template_parms (tree parm_parms, parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, i)); arg = TREE_VALUE (TREE_VEC_ELT (arg_parms, i)); - if (arg == NULL_TREE || arg == error_mark_node - || parm == NULL_TREE || parm == error_mark_node) - return 0; - - if (TREE_CODE (arg) != TREE_CODE (parm)) + if (!coerce_template_template_parm (parm, arg, complain, in_decl, + outer_args)) return 0; - switch (TREE_CODE (parm)) - { - case TEMPLATE_DECL: - /* We encounter instantiations of templates like - template <template <template <class> class> class TT> - class C; */ - { - tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm); - tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg); - - if (!coerce_template_template_parms - (parmparm, argparm, complain, in_decl, outer_args)) - return 0; - } - /* Fall through. */ - - case TYPE_DECL: - if (TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (parm)) - != TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (arg))) - /* One is a parameter pack, the other is not. */ - return 0; - break; - - case PARM_DECL: - /* The tsubst call is used to handle cases such as - - template <int> class C {}; - template <class T, template <T> class TT> class D {}; - D<int, C> d; + } - i.e. the parameter list of TT depends on earlier parameters. */ - if (!dependent_type_p (TREE_TYPE (arg)) - && !same_type_p - (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl), - TREE_TYPE (arg))) - return 0; + if (variadic_p) + { + /* Check each of the template parameters in the template + argument against the template parameter pack at the end of + the template template parameter. */ + if (TREE_VEC_ELT (parm_parms, i) == error_mark_node) + return 0; - if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)) - != TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (arg))) - /* One is a parameter pack, the other is not. */ - return 0; - break; + parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, i)); - default: - gcc_unreachable (); - } + for (; i < nargs; ++i) + { + if (TREE_VEC_ELT (arg_parms, i) == error_mark_node) + continue; + + arg = TREE_VALUE (TREE_VEC_ELT (arg_parms, i)); + + if (!coerce_template_template_parm (parm, arg, complain, in_decl, + outer_args)) + return 0; + } } + return 1; } @@ -10684,7 +10758,7 @@ tsubst_copy_and_build (tree t, r = convert_from_reference (r); } else - r = build_x_indirect_ref (r, "unary *"); + r = build_x_indirect_ref (r, "unary *", complain); return r; } @@ -10706,8 +10780,9 @@ tsubst_copy_and_build (tree t, if (integral_constant_expression_p && !cast_valid_in_integral_constant_expression_p (type)) { - error ("a cast to a type other than an integral or " - "enumeration type cannot appear in a constant-expression"); + if (complain & tf_error) + error ("a cast to a type other than an integral or " + "enumeration type cannot appear in a constant-expression"); return error_mark_node; } @@ -10716,15 +10791,15 @@ tsubst_copy_and_build (tree t, switch (TREE_CODE (t)) { case CAST_EXPR: - return build_functional_cast (type, op); + return build_functional_cast (type, op, complain); case REINTERPRET_CAST_EXPR: - return build_reinterpret_cast (type, op); + return build_reinterpret_cast (type, op, complain); case CONST_CAST_EXPR: - return build_const_cast (type, op); + return build_const_cast (type, op, complain); case DYNAMIC_CAST_EXPR: - return build_dynamic_cast (type, op); + return build_dynamic_cast (type, op, complain); case STATIC_CAST_EXPR: - return build_static_cast (type, op); + return build_static_cast (type, op, complain); default: gcc_unreachable (); } @@ -10734,7 +10809,7 @@ tsubst_copy_and_build (tree t, case POSTINCREMENT_EXPR: op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0), args, complain, in_decl); - return build_x_unary_op (TREE_CODE (t), op1); + return build_x_unary_op (TREE_CODE (t), op1, complain); case PREDECREMENT_EXPR: case PREINCREMENT_EXPR: @@ -10745,7 +10820,8 @@ tsubst_copy_and_build (tree t, case UNARY_PLUS_EXPR: /* Unary + */ case REALPART_EXPR: case IMAGPART_EXPR: - return build_x_unary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0))); + return build_x_unary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)), + complain); case ADDR_EXPR: op1 = TREE_OPERAND (t, 0); @@ -10757,7 +10833,7 @@ tsubst_copy_and_build (tree t, in_decl); if (TREE_CODE (op1) == LABEL_DECL) return finish_label_address_expr (DECL_NAME (op1)); - return build_x_unary_op (ADDR_EXPR, op1); + return build_x_unary_op (ADDR_EXPR, op1, complain); case PLUS_EXPR: case MINUS_EXPR: @@ -10800,7 +10876,8 @@ tsubst_copy_and_build (tree t, (TREE_NO_WARNING (TREE_OPERAND (t, 1)) ? ERROR_MARK : TREE_CODE (TREE_OPERAND (t, 1))), - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, + complain); case SCOPE_REF: return tsubst_qualified_id (t, args, complain, in_decl, /*done=*/true, @@ -10816,7 +10893,8 @@ tsubst_copy_and_build (tree t, (TREE_NO_WARNING (TREE_OPERAND (t, 1)) ? ERROR_MARK : TREE_CODE (TREE_OPERAND (t, 1))), - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, + complain); case SIZEOF_EXPR: if (PACK_EXPANSION_P (TREE_OPERAND (t, 0))) @@ -10849,16 +10927,19 @@ tsubst_copy_and_build (tree t, --skip_evaluation; } if (TYPE_P (op1)) - return cxx_sizeof_or_alignof_type (op1, TREE_CODE (t), true); + return cxx_sizeof_or_alignof_type (op1, TREE_CODE (t), + complain & tf_error); else - return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t)); + return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t), + complain & tf_error); case MODOP_EXPR: { tree r = build_x_modify_expr (RECUR (TREE_OPERAND (t, 0)), TREE_CODE (TREE_OPERAND (t, 1)), - RECUR (TREE_OPERAND (t, 2))); + RECUR (TREE_OPERAND (t, 2)), + complain); /* TREE_NO_WARNING must be set if either the expression was parenthesized or it uses an operator such as >>= rather than plain assignment. In the former case, it was already @@ -10896,7 +10977,8 @@ tsubst_copy_and_build (tree t, RECUR (TREE_OPERAND (t, 1)), RECUR (TREE_OPERAND (t, 2)), init, - NEW_EXPR_USE_GLOBAL (t)); + NEW_EXPR_USE_GLOBAL (t), + complain); } case DELETE_EXPR: @@ -10908,7 +10990,8 @@ tsubst_copy_and_build (tree t, case COMPOUND_EXPR: return build_x_compound_expr (RECUR (TREE_OPERAND (t, 0)), - RECUR (TREE_OPERAND (t, 1))); + RECUR (TREE_OPERAND (t, 1)), + complain); case CALL_EXPR: { @@ -10982,25 +11065,29 @@ tsubst_copy_and_build (tree t, if (!BASELINK_P (TREE_OPERAND (function, 1))) return finish_call_expr (function, call_args, /*disallow_virtual=*/false, - /*koenig_p=*/false); + /*koenig_p=*/false, + complain); else return (build_new_method_call (TREE_OPERAND (function, 0), TREE_OPERAND (function, 1), call_args, NULL_TREE, qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL, - /*fn_p=*/NULL)); + /*fn_p=*/NULL, + complain)); } return finish_call_expr (function, call_args, /*disallow_virtual=*/qualified_p, - koenig_p); + koenig_p, + complain); } case COND_EXPR: return build_x_conditional_expr (RECUR (TREE_OPERAND (t, 0)), RECUR (TREE_OPERAND (t, 1)), - RECUR (TREE_OPERAND (t, 2))); + RECUR (TREE_OPERAND (t, 2)), + complain); case PSEUDO_DTOR_EXPR: return finish_pseudo_destructor_expr @@ -11184,7 +11271,8 @@ tsubst_copy_and_build (tree t, return finish_non_static_data_member (member, object, NULL_TREE); return finish_class_member_access_expr (object, member, - /*template_p=*/false); + /*template_p=*/false, + complain); } case THROW_EXPR: @@ -12811,8 +12899,9 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) { tree parmvec = TYPE_TI_ARGS (parm); tree argvec = INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (arg)); - tree argtmplvec - = DECL_INNERMOST_TEMPLATE_PARMS (TYPE_TI_TEMPLATE (arg)); + tree parm_parms + = DECL_INNERMOST_TEMPLATE_PARMS + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (parm)); int i, len; int parm_variadic_p = 0; @@ -12843,7 +12932,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) Here, if Lvalue_proxy is permitted to bind to View, then the global operator+ will be used; if they are not, the Lvalue_proxy will be converted to float. */ - if (coerce_template_parms (argtmplvec, parmvec, + if (coerce_template_parms (parm_parms, + argvec, TYPE_TI_TEMPLATE (parm), tf_none, /*require_all_args=*/true, diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 8bd51c80a20..d17ef6433e1 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -104,7 +104,7 @@ static GTY (()) VEC(tinfo_s,gc) *tinfo_descs; static tree ifnonnull (tree, tree); static tree tinfo_name (tree); -static tree build_dynamic_cast_1 (tree, tree); +static tree build_dynamic_cast_1 (tree, tree, tsubst_flags_t); static tree throw_bad_cast (void); static tree throw_bad_typeid (void); static tree get_tinfo_decl_dynamic (tree); @@ -188,7 +188,9 @@ build_headof (tree exp) index = build_int_cst (NULL_TREE, -2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE); - offset = build_vtbl_ref (build_indirect_ref (exp, NULL), index); + offset = build_vtbl_ref (cp_build_indirect_ref (exp, NULL, + tf_warning_or_error), + index); type = build_qualified_type (ptr_type_node, cp_type_quals (TREE_TYPE (exp))); @@ -272,7 +274,7 @@ get_tinfo_decl_dynamic (tree exp) /* Otherwise return the type_info for the static type of the expr. */ t = get_tinfo_ptr (TYPE_MAIN_VARIANT (type)); - return build_indirect_ref (t, NULL); + return cp_build_indirect_ref (t, NULL, tf_warning_or_error); } static bool @@ -463,7 +465,8 @@ get_typeid (tree type) if (!type) return error_mark_node; - return build_indirect_ref (get_tinfo_ptr (type), NULL); + return cp_build_indirect_ref (get_tinfo_ptr (type), NULL, + tf_warning_or_error); } /* Check whether TEST is null before returning RESULT. If TEST is used in @@ -483,7 +486,7 @@ ifnonnull (tree test, tree result) paper. */ static tree -build_dynamic_cast_1 (tree type, tree expr) +build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) { enum tree_code tc = TREE_CODE (type); tree exprtype = TREE_TYPE (expr); @@ -626,8 +629,9 @@ build_dynamic_cast_1 (tree type, tree expr) && TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE) { tree expr = throw_bad_cast (); - warning (0, "dynamic_cast of %q#D to %q#T can never succeed", - old_expr, type); + if (complain & tf_warning) + warning (0, "dynamic_cast of %q#D to %q#T can never succeed", + old_expr, type); /* Bash it to the expected type. */ TREE_TYPE (expr) = type; return expr; @@ -640,8 +644,9 @@ build_dynamic_cast_1 (tree type, tree expr) if (TREE_CODE (op) == VAR_DECL && TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE) { - warning (0, "dynamic_cast of %q#D to %q#T can never succeed", - op, type); + if (complain & tf_warning) + warning (0, "dynamic_cast of %q#D to %q#T can never succeed", + op, type); retval = build_int_cst (type, 0); return retval; } @@ -650,7 +655,8 @@ build_dynamic_cast_1 (tree type, tree expr) /* Use of dynamic_cast when -fno-rtti is prohibited. */ if (!flag_rtti) { - error ("%<dynamic_cast%> not permitted with -fno-rtti"); + if (complain & tf_error) + error ("%<dynamic_cast%> not permitted with -fno-rtti"); return error_mark_node; } @@ -658,10 +664,10 @@ build_dynamic_cast_1 (tree type, tree expr) static_type = TYPE_MAIN_VARIANT (TREE_TYPE (exprtype)); td2 = get_tinfo_decl (target_type); mark_used (td2); - td2 = build_unary_op (ADDR_EXPR, td2, 0); + td2 = cp_build_unary_op (ADDR_EXPR, td2, 0, complain); td3 = get_tinfo_decl (static_type); mark_used (td3); - td3 = build_unary_op (ADDR_EXPR, td3, 0); + td3 = cp_build_unary_op (ADDR_EXPR, td3, 0, complain); /* Determine how T and V are related. */ boff = dcast_base_hint (static_type, target_type); @@ -671,7 +677,7 @@ build_dynamic_cast_1 (tree type, tree expr) expr1 = expr; if (tc == REFERENCE_TYPE) - expr1 = build_unary_op (ADDR_EXPR, expr1, 0); + expr1 = cp_build_unary_op (ADDR_EXPR, expr1, 0, complain); elems[0] = expr1; elems[1] = td3; @@ -726,13 +732,14 @@ build_dynamic_cast_1 (tree type, tree expr) errstr = "source type is not polymorphic"; fail: - error ("cannot dynamic_cast %qE (of type %q#T) to type %q#T (%s)", - expr, exprtype, type, errstr); + if (complain & tf_error) + error ("cannot dynamic_cast %qE (of type %q#T) to type %q#T (%s)", + expr, exprtype, type, errstr); return error_mark_node; } tree -build_dynamic_cast (tree type, tree expr) +build_dynamic_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || expr == error_mark_node) return error_mark_node; @@ -744,7 +751,7 @@ build_dynamic_cast (tree type, tree expr) return convert_from_reference (expr); } - return convert_from_reference (build_dynamic_cast_1 (type, expr)); + return convert_from_reference (build_dynamic_cast_1 (type, expr, complain)); } /* Return the runtime bit mask encoding the qualifiers of TYPE. */ @@ -876,7 +883,8 @@ tinfo_base_init (tinfo_s *ti, tree target) } vtable_ptr = get_vtable_decl (real_type, /*complete=*/1); - vtable_ptr = build_unary_op (ADDR_EXPR, vtable_ptr, 0); + vtable_ptr = cp_build_unary_op (ADDR_EXPR, vtable_ptr, 0, + tf_warning_or_error); /* We need to point into the middle of the vtable. */ vtable_ptr = build2 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 74d9ae55af2..8966bf5d921 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -536,7 +536,7 @@ simplify_loop_decl_cond (tree *cond_p, tree body) *cond_p = boolean_true_node; if_stmt = begin_if_stmt (); - cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0); + cond = cp_build_unary_op (TRUTH_NOT_EXPR, cond, 0, tf_warning_or_error); finish_if_stmt_cond (cond, if_stmt); finish_break_stmt (); finish_then_clause (if_stmt); @@ -614,10 +614,11 @@ finish_expr_stmt (tree expr) { if (warn_sequence_point) verify_sequence_points (expr); - expr = convert_to_void (expr, "statement"); + expr = convert_to_void (expr, "statement", tf_warning_or_error); } else if (!type_dependent_expression_p (expr)) - convert_to_void (build_non_dependent_expr (expr), "statement"); + convert_to_void (build_non_dependent_expr (expr), "statement", + tf_warning_or_error); if (check_for_bare_parameter_packs (expr)) expr = error_mark_node; @@ -872,10 +873,12 @@ finish_for_expr (tree expr, tree for_stmt) { if (warn_sequence_point) verify_sequence_points (expr); - expr = convert_to_void (expr, "3rd expression in for"); + expr = convert_to_void (expr, "3rd expression in for", + tf_warning_or_error); } else if (!type_dependent_expression_p (expr)) - convert_to_void (build_non_dependent_expr (expr), "3rd expression in for"); + convert_to_void (build_non_dependent_expr (expr), "3rd expression in for", + tf_warning_or_error); expr = maybe_cleanup_point_expr_void (expr); if (check_for_bare_parameter_packs (expr)) expr = error_mark_node; @@ -1247,7 +1250,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands, otherwise we'll get an error. Gross, but ... */ STRIP_NOPS (operand); - if (!lvalue_or_else (operand, lv_asm)) + if (!lvalue_or_else (operand, lv_asm, tf_warning_or_error)) operand = error_mark_node; if (operand != error_mark_node @@ -1505,7 +1508,8 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) return build_class_member_access_expr (object, decl, /*access_path=*/NULL_TREE, - /*preserve_reference=*/false); + /*preserve_reference=*/false, + tf_warning_or_error); } } @@ -1643,7 +1647,8 @@ finish_qualified_id_expr (tree qualifying_class, (maybe_dummy_object (qualifying_class, NULL), expr, BASELINK_ACCESS_BINFO (expr), - /*preserve_reference=*/false)); + /*preserve_reference=*/false, + tf_warning_or_error)); else if (done) /* The expression is a qualified name whose address is not being taken. */ @@ -1832,7 +1837,8 @@ perform_koenig_lookup (tree fn, tree args) Returns code for the call. */ tree -finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) +finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p, + tsubst_flags_t complain) { tree result; tree orig_fn; @@ -1931,7 +1937,8 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) result = build_new_method_call (object, fn, args, NULL_TREE, (disallow_virtual ? LOOKUP_NONVIRTUAL : 0), - /*fn_p=*/NULL); + /*fn_p=*/NULL, + complain); } else if (is_overloaded_fn (fn)) { @@ -1943,7 +1950,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) if (!result) /* A call to a namespace-scope function. */ - result = build_new_function_call (fn, args, koenig_p); + result = build_new_function_call (fn, args, koenig_p, complain); } else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR) { @@ -1960,11 +1967,11 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) /* If the "function" is really an object of class type, it might have an overloaded `operator ()'. */ result = build_new_op (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE, - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, complain); if (!result) /* A call where the function is unknown. */ - result = build_function_call (fn, args); + result = cp_build_function_call (fn, args, complain); if (processing_template_decl) { @@ -1981,7 +1988,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) tree finish_increment_expr (tree expr, enum tree_code code) { - return build_x_unary_op (code, expr); + return build_x_unary_op (code, expr, tf_warning_or_error); } /* Finish a use of `this'. Returns an expression for `this'. */ @@ -2070,7 +2077,7 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor) tree finish_unary_op_expr (enum tree_code code, tree expr) { - tree result = build_x_unary_op (code, expr); + tree result = build_x_unary_op (code, expr, tf_warning_or_error); /* Inside a template, build_x_unary_op does not fold the expression. So check whether the result is folded before setting TREE_NEGATED_INT. */ @@ -2952,7 +2959,8 @@ finish_id_expression (tree id_expression, /* A set of member functions. */ decl = maybe_dummy_object (DECL_CONTEXT (first_fn), 0); return finish_class_member_access_expr (decl, id_expression, - /*template_p=*/false); + /*template_p=*/false, + tf_warning_or_error); } decl = baselink_for_fns (decl); @@ -3119,7 +3127,8 @@ simplify_aggr_init_expr (tree *tp) SLOT. */ push_deferring_access_checks (dk_no_check); call_expr = build_aggr_init (slot, call_expr, - DIRECT_BIND | LOOKUP_ONLYCONVERTING); + DIRECT_BIND | LOOKUP_ONLYCONVERTING, + tf_warning_or_error); pop_deferring_access_checks (); call_expr = build2 (COMPOUND_EXPR, TREE_TYPE (slot), call_expr, slot); } @@ -3668,7 +3677,8 @@ finish_omp_clauses (tree clauses) } t = build_special_member_call (NULL_TREE, complete_ctor_identifier, - t, inner_type, LOOKUP_NORMAL); + t, inner_type, LOOKUP_NORMAL, + tf_warning_or_error); if (targetm.cxx.cdtor_returns_this () || errorcount) /* Because constructors and destructors return this, @@ -3690,7 +3700,8 @@ finish_omp_clauses (tree clauses) t = build_int_cst (build_pointer_type (inner_type), 0); t = build1 (INDIRECT_REF, inner_type, t); t = build_special_member_call (t, complete_dtor_identifier, - NULL, inner_type, LOOKUP_NORMAL); + NULL, inner_type, LOOKUP_NORMAL, + tf_warning_or_error); if (targetm.cxx.cdtor_returns_this () || errorcount) /* Because constructors and destructors return this, @@ -3713,7 +3724,8 @@ finish_omp_clauses (tree clauses) t = build1 (INDIRECT_REF, inner_type, t); t = build_special_member_call (t, ansi_assopname (NOP_EXPR), build_tree_list (NULL, t), - inner_type, LOOKUP_NORMAL); + inner_type, LOOKUP_NORMAL, + tf_warning_or_error); /* We'll have called convert_from_reference on the call, which may well have added an indirect_ref. It's unneeded here, @@ -3937,7 +3949,7 @@ finish_omp_for (location_t locus, tree decl, tree init, tree cond, if (!processing_template_decl) init = fold_build_cleanup_point_expr (TREE_TYPE (init), init); - init = build_modify_expr (decl, NOP_EXPR, init); + init = cp_build_modify_expr (decl, NOP_EXPR, init, tf_warning_or_error); if (cond && TREE_SIDE_EFFECTS (cond) && COMPARISON_CLASS_P (cond)) { int n = TREE_SIDE_EFFECTS (TREE_OPERAND (cond, 1)) != 0; @@ -4006,7 +4018,7 @@ void finish_omp_barrier (void) { tree fn = built_in_decls[BUILT_IN_GOMP_BARRIER]; - tree stmt = finish_call_expr (fn, NULL, false, false); + tree stmt = finish_call_expr (fn, NULL, false, false, tf_warning_or_error); finish_expr_stmt (stmt); } @@ -4014,7 +4026,7 @@ void finish_omp_flush (void) { tree fn = built_in_decls[BUILT_IN_SYNCHRONIZE]; - tree stmt = finish_call_expr (fn, NULL, false, false); + tree stmt = finish_call_expr (fn, NULL, false, false, tf_warning_or_error); finish_expr_stmt (stmt); } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 927b3de0dea..027f1c9b1f2 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1992,7 +1992,7 @@ tree build_dummy_object (tree type) { tree decl = build1 (NOP_EXPR, build_pointer_type (type), void_zero_node); - return build_indirect_ref (decl, NULL); + return cp_build_indirect_ref (decl, NULL, tf_warning_or_error); } /* We've gotten a reference to a member of TYPE. Return *this if appropriate, @@ -2569,10 +2569,10 @@ stabilize_expr (tree exp, tree* initp) } else { - exp = build_unary_op (ADDR_EXPR, exp, 1); + exp = cp_build_unary_op (ADDR_EXPR, exp, 1, tf_warning_or_error); init_expr = get_target_expr (exp); exp = TARGET_EXPR_SLOT (init_expr); - exp = build_indirect_ref (exp, 0); + exp = cp_build_indirect_ref (exp, 0, tf_warning_or_error); } *initp = init_expr; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 036f93efecb..2e8151b1ff3 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -47,9 +47,11 @@ along with GCC; see the file COPYING3. If not see static tree pfn_from_ptrmemfunc (tree); static tree delta_from_ptrmemfunc (tree); -static tree convert_for_assignment (tree, tree, const char *, tree, int); +static tree convert_for_assignment (tree, tree, const char *, tree, int, + tsubst_flags_t); static tree cp_pointer_int_sum (enum tree_code, tree, tree); -static tree rationalize_conditional_expr (enum tree_code, tree); +static tree rationalize_conditional_expr (enum tree_code, tree, + tsubst_flags_t); static int comp_ptr_ttypes_real (tree, tree, int); static bool comp_except_types (tree, tree, bool); static bool comp_array_types (const_tree, const_tree, bool); @@ -59,7 +61,8 @@ static void casts_away_constness_r (tree *, tree *); static bool casts_away_constness (tree, tree); static void maybe_warn_about_returning_address_of_local (tree); static tree lookup_destructor (tree, tree, tree); -static int convert_arguments (int, tree *, tree, tree, tree, int); +static int convert_arguments (int, tree *, tree, tree, tree, int, + tsubst_flags_t); /* Do `exp = require_complete_type (exp);' to make sure exp does not have an incomplete type. (That includes void types.) @@ -394,7 +397,8 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) case. See that function for documentation fo the parameters. */ static tree -composite_pointer_type_r (tree t1, tree t2, const char* location) +composite_pointer_type_r (tree t1, tree t2, const char* location, + tsubst_flags_t complain) { tree pointee1; tree pointee2; @@ -426,12 +430,14 @@ composite_pointer_type_r (tree t1, tree t2, const char* location) && TREE_CODE (pointee2) == POINTER_TYPE) || (TYPE_PTR_TO_MEMBER_P (pointee1) && TYPE_PTR_TO_MEMBER_P (pointee2))) - result_type = composite_pointer_type_r (pointee1, pointee2, location); + result_type = composite_pointer_type_r (pointee1, pointee2, location, + complain); else { - pedwarn ("%s between distinct pointer types %qT and %qT " - "lacks a cast", - location, t1, t2); + if (complain & tf_error) + pedwarn ("%s between distinct pointer types %qT and %qT " + "lacks a cast", + location, t1, t2); result_type = void_type_node; } result_type = cp_build_qualified_type (result_type, @@ -442,7 +448,8 @@ composite_pointer_type_r (tree t1, tree t2, const char* location) if (TYPE_PTR_TO_MEMBER_P (t1)) { if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1), - TYPE_PTRMEM_CLASS_TYPE (t2))) + TYPE_PTRMEM_CLASS_TYPE (t2)) + && (complain & tf_error)) pedwarn ("%s between distinct pointer types %qT and %qT " "lacks a cast", location, t1, t2); @@ -466,7 +473,7 @@ composite_pointer_type_r (tree t1, tree t2, const char* location) tree composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, - const char* location) + const char* location, tsubst_flags_t complain) { tree class1; tree class2; @@ -504,7 +511,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, tree attributes; tree result_type; - if (pedantic && TYPE_PTRFN_P (t2)) + if (pedantic && TYPE_PTRFN_P (t2) && (complain & tf_error)) pedwarn ("ISO C++ forbids %s between pointer of type %<void *%> " "and pointer-to-function", location); result_type @@ -543,8 +550,9 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, (cp_build_qualified_type (class2, TYPE_QUALS (class1)))); else { - error ("%s between distinct pointer types %qT and %qT " - "lacks a cast", location, t1, t2); + if (complain & tf_error) + error ("%s between distinct pointer types %qT and %qT " + "lacks a cast", location, t1, t2); return error_mark_node; } } @@ -563,13 +571,14 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, t2 = build_ptrmem_type (class1, TYPE_PTRMEM_POINTED_TO_TYPE (t2)); else { - error ("%s between distinct pointer-to-member types %qT and %qT " - "lacks a cast", location, t1, t2); + if (complain & tf_error) + error ("%s between distinct pointer-to-member types %qT and %qT " + "lacks a cast", location, t1, t2); return error_mark_node; } } - return composite_pointer_type_r (t1, t2, location); + return composite_pointer_type_r (t1, t2, location, complain); } /* Return the merged type of two types. @@ -764,7 +773,7 @@ common_type (tree t1, tree t2) || (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2)) || (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2))) return composite_pointer_type (t1, t2, error_mark_node, error_mark_node, - "conversion"); + "conversion", tf_warning_or_error); else gcc_unreachable (); } @@ -1299,10 +1308,27 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain) complain); } +/* Return the size of the type, without producing any warnings for + types whose size cannot be taken. This routine should be used only + in some other routine that has already produced a diagnostic about + using the size of such a type. */ +tree +cxx_sizeof_nowarn (tree type) +{ + if (TREE_CODE (type) == FUNCTION_TYPE + || TREE_CODE (type) == VOID_TYPE + || TREE_CODE (type) == ERROR_MARK) + return size_one_node; + else if (!COMPLETE_TYPE_P (type)) + return size_zero_node; + else + return cxx_sizeof_or_alignof_type (type, SIZEOF_EXPR, false); +} + /* Process a sizeof expression where the operand is an expression. */ static tree -cxx_sizeof_expr (tree e) +cxx_sizeof_expr (tree e, tsubst_flags_t complain) { if (e == error_mark_node) return error_mark_node; @@ -1320,24 +1346,33 @@ cxx_sizeof_expr (tree e) && TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL && DECL_C_BIT_FIELD (TREE_OPERAND (e, 1))) { - error ("invalid application of %<sizeof%> to a bit-field"); + if (complain & tf_error) + error ("invalid application of %<sizeof%> to a bit-field"); + else + return error_mark_node; e = char_type_node; } else if (is_overloaded_fn (e)) { - pedwarn ("ISO C++ forbids applying %<sizeof%> to an expression of " - "function type"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids applying %<sizeof%> to an expression of " + "function type"); + else + return error_mark_node; e = char_type_node; } else if (type_unknown_p (e)) { - cxx_incomplete_type_error (e, TREE_TYPE (e)); + if (complain & tf_error) + cxx_incomplete_type_error (e, TREE_TYPE (e)); + else + return error_mark_node; e = char_type_node; } else e = TREE_TYPE (e); - return cxx_sizeof_or_alignof_type (e, SIZEOF_EXPR, true); + return cxx_sizeof_or_alignof_type (e, SIZEOF_EXPR, complain & tf_error); } /* Implement the __alignof keyword: Return the minimum required @@ -1346,7 +1381,7 @@ cxx_sizeof_expr (tree e) "aligned" __attribute__ specification). */ static tree -cxx_alignof_expr (tree e) +cxx_alignof_expr (tree e, tsubst_flags_t complain) { tree t; @@ -1368,7 +1403,10 @@ cxx_alignof_expr (tree e) && TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL && DECL_C_BIT_FIELD (TREE_OPERAND (e, 1))) { - error ("invalid application of %<__alignof%> to a bit-field"); + if (complain & tf_error) + error ("invalid application of %<__alignof%> to a bit-field"); + else + return error_mark_node; t = size_one_node; } else if (TREE_CODE (e) == COMPONENT_REF @@ -1376,8 +1414,11 @@ cxx_alignof_expr (tree e) t = size_int (DECL_ALIGN_UNIT (TREE_OPERAND (e, 1))); else if (is_overloaded_fn (e)) { - pedwarn ("ISO C++ forbids applying %<__alignof%> to an expression of " - "function type"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids applying %<__alignof%> to an expression of " + "function type"); + else + return error_mark_node; if (TREE_CODE (e) == FUNCTION_DECL) t = size_int (DECL_ALIGN_UNIT (e)); else @@ -1385,11 +1426,15 @@ cxx_alignof_expr (tree e) } else if (type_unknown_p (e)) { - cxx_incomplete_type_error (e, TREE_TYPE (e)); + if (complain & tf_error) + cxx_incomplete_type_error (e, TREE_TYPE (e)); + else + return error_mark_node; t = size_one_node; } else - return cxx_sizeof_or_alignof_type (TREE_TYPE (e), ALIGNOF_EXPR, true); + return cxx_sizeof_or_alignof_type (TREE_TYPE (e), ALIGNOF_EXPR, + complain & tf_error); return fold_convert (size_type_node, t); } @@ -1398,12 +1443,12 @@ cxx_alignof_expr (tree e) is an expression. */ tree -cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) +cxx_sizeof_or_alignof_expr (tree e, enum tree_code op, bool complain) { if (op == SIZEOF_EXPR) - return cxx_sizeof_expr (e); + return cxx_sizeof_expr (e, complain? tf_warning_or_error : tf_none); else - return cxx_alignof_expr (e); + return cxx_alignof_expr (e, complain? tf_warning_or_error : tf_none); } /* EXPR is being used in a context that is not a function call. @@ -1423,11 +1468,12 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) violates these rules. */ bool -invalid_nonstatic_memfn_p (const_tree expr) +invalid_nonstatic_memfn_p (const_tree expr, tsubst_flags_t complain) { if (TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE) { - error ("invalid use of non-static member function"); + if (complain & tf_error) + error ("invalid use of non-static member function"); return true; } return false; @@ -1536,10 +1582,10 @@ decay_conversion (tree exp) error ("void value not ignored as it ought to be"); return error_mark_node; } - if (invalid_nonstatic_memfn_p (exp)) + if (invalid_nonstatic_memfn_p (exp, tf_warning_or_error)) return error_mark_node; if (code == FUNCTION_TYPE || is_overloaded_fn (exp)) - return build_unary_op (ADDR_EXPR, exp, 0); + return cp_build_unary_op (ADDR_EXPR, exp, 0, tf_warning_or_error); if (code == ARRAY_TYPE) { tree adr; @@ -1574,7 +1620,7 @@ decay_conversion (tree exp) } /* This way is better for a COMPONENT_REF since it can simplify the offset for a component. */ - adr = build_unary_op (ADDR_EXPR, exp, 1); + adr = cp_build_unary_op (ADDR_EXPR, exp, 1, tf_warning_or_error); return cp_convert (ptrtype, adr); } @@ -1715,7 +1761,8 @@ string_conv_p (const_tree totype, const_tree exp, int warn) get it there. */ static tree -rationalize_conditional_expr (enum tree_code code, tree t) +rationalize_conditional_expr (enum tree_code code, tree t, + tsubst_flags_t complain) { /* For MIN_EXPR or MAX_EXPR, fold-const.c has arranged things so that the first operand is always the one to be used if both operands @@ -1733,15 +1780,20 @@ rationalize_conditional_expr (enum tree_code code, tree t) ? LE_EXPR : GE_EXPR), op0, TREE_CODE (op0), op1, TREE_CODE (op1), - /*overloaded_p=*/NULL), - build_unary_op (code, op0, 0), - build_unary_op (code, op1, 0)); + /*overloaded_p=*/NULL, + complain), + cp_build_unary_op (code, op0, 0, complain), + cp_build_unary_op (code, op1, 0, complain), + complain); } return build_conditional_expr (TREE_OPERAND (t, 0), - build_unary_op (code, TREE_OPERAND (t, 1), 0), - build_unary_op (code, TREE_OPERAND (t, 2), 0)); + cp_build_unary_op (code, TREE_OPERAND (t, 1), 0, + complain), + cp_build_unary_op (code, TREE_OPERAND (t, 2), 0, + complain), + complain); } /* Given the TYPE of an anonymous union field inside T, return the @@ -1794,7 +1846,8 @@ lookup_anon_field (tree t, tree type) tree build_class_member_access_expr (tree object, tree member, - tree access_path, bool preserve_reference) + tree access_path, bool preserve_reference, + tsubst_flags_t complain) { tree object_type; tree member_scope; @@ -1815,8 +1868,9 @@ build_class_member_access_expr (tree object, tree member, return error_mark_node; if (!CLASS_TYPE_P (object_type)) { - error ("request for member %qD in %qE, which is of non-class type %qT", - member, object, object_type); + if (complain & tf_error) + error ("request for member %qD in %qE, which is of non-class type %qT", + member, object, object_type); return error_mark_node; } @@ -1841,10 +1895,13 @@ build_class_member_access_expr (tree object, tree member, member_scope = TYPE_CONTEXT (member_scope); if (!member_scope || !DERIVED_FROM_P (member_scope, object_type)) { - if (TREE_CODE (member) == FIELD_DECL) - error ("invalid use of nonstatic data member %qE", member); - else - error ("%qD is not a member of %qT", member, object_type); + if (complain & tf_error) + { + if (TREE_CODE (member) == FIELD_DECL) + error ("invalid use of nonstatic data member %qE", member); + else + error ("%qD is not a member of %qT", member, object_type); + } return error_mark_node; } @@ -1854,7 +1911,7 @@ build_class_member_access_expr (tree object, tree member, { tree temp = unary_complex_lvalue (ADDR_EXPR, object); if (temp) - object = build_indirect_ref (temp, NULL); + object = cp_build_indirect_ref (temp, NULL, complain); } /* In [expr.ref], there is an explicit list of the valid choices for @@ -1894,10 +1951,13 @@ build_class_member_access_expr (tree object, tree member, offsetof macro. */ if (null_object_p && kind == bk_via_virtual) { - error ("invalid access to non-static data member %qD of " - "NULL object", - member); - error ("(perhaps the %<offsetof%> macro was used incorrectly)"); + if (complain & tf_error) + { + error ("invalid access to non-static data member %qD of " + "NULL object", + member); + error ("(perhaps the %<offsetof%> macro was used incorrectly)"); + } return error_mark_node; } @@ -1920,7 +1980,8 @@ build_class_member_access_expr (tree object, tree member, if (null_object_p && warn_invalid_offsetof && CLASSTYPE_NON_POD_P (object_type) && !DECL_FIELD_IS_BASE (member) - && !skip_evaluation) + && !skip_evaluation + && (complain & tf_warning)) { warning (OPT_Winvalid_offsetof, "invalid access to non-static data member %qD " @@ -1950,7 +2011,8 @@ build_class_member_access_expr (tree object, tree member, object = build_class_member_access_expr (object, anonymous_union, /*access_path=*/NULL_TREE, - preserve_reference); + preserve_reference, + complain); } /* Compute the type of the field, as described in [expr.ref]. */ @@ -2011,7 +2073,8 @@ build_class_member_access_expr (tree object, tree member, } else { - error ("invalid use of %qD", member); + if (complain & tf_error) + error ("invalid use of %qD", member); return error_mark_node; } @@ -2117,7 +2180,8 @@ check_template_keyword (tree decl) be a template via the use of the "A::template B" syntax. */ tree -finish_class_member_access_expr (tree object, tree name, bool template_p) +finish_class_member_access_expr (tree object, tree name, bool template_p, + tsubst_flags_t complain) { tree expr; tree object_type; @@ -2165,8 +2229,9 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) return error_mark_node; if (!CLASS_TYPE_P (object_type)) { - error ("request for member %qD in %qE, which is of non-class type %qT", - name, object, object_type); + if (complain & tf_error) + error ("request for member %qD in %qE, which is of non-class type %qT", + name, object, object_type); return error_mark_node; } @@ -2203,8 +2268,9 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) name a member of OBJECT_TYPE. */ if (TREE_CODE (scope) == NAMESPACE_DECL) { - error ("%<%D::%D%> is not a member of %qT", - scope, name, object_type); + if (complain & tf_error) + error ("%<%D::%D%> is not a member of %qT", + scope, name, object_type); return error_mark_node; } @@ -2218,7 +2284,8 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) return error_mark_node; if (!access_path) { - error ("%qT is not a base of %qT", scope, object_type); + if (complain & tf_error) + error ("%qT is not a base of %qT", scope, object_type); return error_mark_node; } } @@ -2237,7 +2304,8 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) /*want_type=*/false); if (member == NULL_TREE) { - error ("%qD has no member named %qE", object_type, name); + if (complain & tf_error) + error ("%qD has no member named %qE", object_type, name); return error_mark_node; } if (member == error_mark_node) @@ -2252,7 +2320,8 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) template = lookup_template_function (template, template_args); else { - error ("%qD is not a member template function", name); + if (complain & tf_error) + error ("%qD is not a member template function", name); return error_mark_node; } } @@ -2265,7 +2334,8 @@ finish_class_member_access_expr (tree object, tree name, bool template_p) check_template_keyword (member); expr = build_class_member_access_expr (object, member, access_path, - /*preserve_reference=*/false); + /*preserve_reference=*/false, + complain); if (processing_template_decl && expr != error_mark_node) { if (BASELINK_P (member)) @@ -2318,7 +2388,8 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) Must also handle REFERENCE_TYPEs for C++. */ tree -build_x_indirect_ref (tree expr, const char *errorstring) +build_x_indirect_ref (tree expr, const char *errorstring, + tsubst_flags_t complain) { tree orig_expr = expr; tree rval; @@ -2331,9 +2402,9 @@ build_x_indirect_ref (tree expr, const char *errorstring) } rval = build_new_op (INDIRECT_REF, LOOKUP_NORMAL, expr, NULL_TREE, - NULL_TREE, /*overloaded_p=*/NULL); + NULL_TREE, /*overloaded_p=*/NULL, complain); if (!rval) - rval = build_indirect_ref (expr, errorstring); + rval = cp_build_indirect_ref (expr, errorstring, complain); if (processing_template_decl && rval != error_mark_node) return build_min_non_dep (INDIRECT_REF, rval, orig_expr); @@ -2341,9 +2412,17 @@ build_x_indirect_ref (tree expr, const char *errorstring) return rval; } +/* Helper function called from c-common. */ tree build_indirect_ref (tree ptr, const char *errorstring) { + return cp_build_indirect_ref (ptr, errorstring, tf_warning_or_error); +} + +tree +cp_build_indirect_ref (tree ptr, const char *errorstring, + tsubst_flags_t complain) +{ tree pointer, type; if (ptr == error_mark_node) @@ -2385,7 +2464,8 @@ build_indirect_ref (tree ptr, const char *errorstring) { /* A pointer to incomplete type (other than cv void) can be dereferenced [expr.unary.op]/1 */ - error ("%qT is not a pointer-to-object type", type); + if (complain & tf_error) + error ("%qT is not a pointer-to-object type", type); return error_mark_node; } else if (TREE_CODE (pointer) == ADDR_EXPR @@ -2407,6 +2487,9 @@ build_indirect_ref (tree ptr, const char *errorstring) return ref; } } + else if (!(complain & tf_error)) + /* Don't emit any errors; we'll just return ERROR_MARK_NODE later. */ + ; /* `pointer' won't be an error_mark_node if we were given a pointer to member, so it's cool to check for this here. */ else if (TYPE_PTR_TO_MEMBER_P (type)) @@ -2462,7 +2545,8 @@ build_array_ref (tree array, tree idx) return build_conditional_expr (TREE_OPERAND (array, 0), build_array_ref (TREE_OPERAND (array, 1), idx), - build_array_ref (TREE_OPERAND (array, 2), idx)); + build_array_ref (TREE_OPERAND (array, 2), idx), + tf_warning_or_error); default: break; @@ -2568,8 +2652,10 @@ build_array_ref (tree array, tree idx) warn_array_subscript_with_type_char (idx); - return build_indirect_ref (cp_build_binary_op (PLUS_EXPR, ar, ind), - "array indexing"); + return cp_build_indirect_ref (cp_build_binary_op (PLUS_EXPR, ar, ind, + tf_warning_or_error), + "array indexing", + tf_warning_or_error); } } @@ -2627,13 +2713,17 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) switch (TARGET_PTRMEMFUNC_VBIT_LOCATION) { case ptrmemfunc_vbit_in_pfn: - e1 = cp_build_binary_op (BIT_AND_EXPR, idx, integer_one_node); - idx = cp_build_binary_op (MINUS_EXPR, idx, integer_one_node); + e1 = cp_build_binary_op (BIT_AND_EXPR, idx, integer_one_node, + tf_warning_or_error); + idx = cp_build_binary_op (MINUS_EXPR, idx, integer_one_node, + tf_warning_or_error); break; case ptrmemfunc_vbit_in_delta: - e1 = cp_build_binary_op (BIT_AND_EXPR, delta, integer_one_node); - delta = cp_build_binary_op (RSHIFT_EXPR, delta, integer_one_node); + e1 = cp_build_binary_op (BIT_AND_EXPR, delta, integer_one_node, + tf_warning_or_error); + delta = cp_build_binary_op (RSHIFT_EXPR, delta, integer_one_node, + tf_warning_or_error); break; default: @@ -2667,12 +2757,12 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) /* Next extract the vtable pointer from the object. */ vtbl = build1 (NOP_EXPR, build_pointer_type (vtbl_ptr_type_node), instance_ptr); - vtbl = build_indirect_ref (vtbl, NULL); + vtbl = cp_build_indirect_ref (vtbl, NULL, tf_warning_or_error); /* Finally, extract the function pointer from the vtable. */ e2 = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl, fold_convert (sizetype, idx)); - e2 = build_indirect_ref (e2, NULL); + e2 = cp_build_indirect_ref (e2, NULL, tf_warning_or_error); TREE_CONSTANT (e2) = 1; TREE_INVARIANT (e2) = 1; @@ -2680,10 +2770,11 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) vtable entry is treated as a function pointer. */ if (TARGET_VTABLE_USES_DESCRIPTORS) e2 = build1 (NOP_EXPR, TREE_TYPE (e2), - build_unary_op (ADDR_EXPR, e2, /*noconvert=*/1)); + cp_build_unary_op (ADDR_EXPR, e2, /*noconvert=*/1, + tf_warning_or_error)); e2 = fold_convert (TREE_TYPE (e3), e2); - e1 = build_conditional_expr (e1, e2, e3); + e1 = build_conditional_expr (e1, e2, e3, tf_warning_or_error); /* Make sure this doesn't get evaluated first inside one of the branches of the COND_EXPR. */ @@ -2696,9 +2787,16 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) return function; } +/* Used by the C-common bits. */ tree build_function_call (tree function, tree params) { + return cp_build_function_call (function, params, tf_warning_or_error); +} + +tree +cp_build_function_call (tree function, tree params, tsubst_flags_t complain) +{ tree fntype, fndecl; tree name = NULL_TREE; int is_method; @@ -2725,7 +2823,7 @@ build_function_call (tree function, tree params) fndecl = function; /* Convert anything with function type to a pointer-to-function. */ - if (pedantic && DECL_MAIN_P (function)) + if (pedantic && DECL_MAIN_P (function) && (complain & tf_error)) pedwarn ("ISO C++ forbids calling %<::main%> from within program"); /* Differs from default_conversion by not setting TREE_ADDRESSABLE @@ -2751,9 +2849,10 @@ build_function_call (tree function, tree params) if (TYPE_PTRMEMFUNC_P (fntype)) { - error ("must use %<.*%> or %<->*%> to call pointer-to-member " - "function in %<%E (...)%>", - original); + if (complain & tf_error) + error ("must use %<.*%> or %<->*%> to call pointer-to-member " + "function in %<%E (...)%>", + original); return error_mark_node; } @@ -2765,7 +2864,8 @@ build_function_call (tree function, tree params) || is_method || TREE_CODE (function) == TEMPLATE_ID_EXPR)) { - error ("%qE cannot be used as a function", original); + if (complain & tf_error) + error ("%qE cannot be used as a function", original); return error_mark_node; } @@ -2783,7 +2883,8 @@ build_function_call (tree function, tree params) /* Convert the parameters to the types declared in the function prototype, or apply default promotions. */ nargs = convert_arguments (nargs, argarray, parm_types, - params, fndecl, LOOKUP_NORMAL); + params, fndecl, LOOKUP_NORMAL, + complain); if (nargs < 0) return error_mark_node; @@ -2818,7 +2919,8 @@ build_function_call (tree function, tree params) static int convert_arguments (int nargs, tree *argarray, - tree typelist, tree values, tree fndecl, int flags) + tree typelist, tree values, tree fndecl, int flags, + tsubst_flags_t complain) { tree typetail, valtail; const char *called_thing = 0; @@ -2853,14 +2955,20 @@ convert_arguments (int nargs, tree *argarray, if (type == void_type_node) { - if (fndecl) - { - error ("too many arguments to %s %q+#D", called_thing, fndecl); - error ("at this point in file"); - } - else - error ("too many arguments to function"); - return i; + if (complain & tf_error) + { + if (fndecl) + { + error ("too many arguments to %s %q+#D", + called_thing, fndecl); + error ("at this point in file"); + } + else + error ("too many arguments to function"); + return i; + } + else + return -1; } /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. @@ -2888,18 +2996,21 @@ convert_arguments (int nargs, tree *argarray, if (!COMPLETE_TYPE_P (complete_type (type))) { - if (fndecl) - error ("parameter %P of %qD has incomplete type %qT", - i, fndecl, type); - else - error ("parameter %P has incomplete type %qT", i, type); + if (complain & tf_error) + { + if (fndecl) + error ("parameter %P of %qD has incomplete type %qT", + i, fndecl, type); + else + error ("parameter %P has incomplete type %qT", i, type); + } parmval = error_mark_node; } else { parmval = convert_for_initialization (NULL_TREE, type, val, flags, - "argument passing", fndecl, i); + "argument passing", fndecl, i, complain); parmval = convert_for_arg_passing (type, parmval); } @@ -2957,13 +3068,17 @@ convert_arguments (int nargs, tree *argarray, } else { - if (fndecl) - { - error ("too few arguments to %s %q+#D", called_thing, fndecl); - error ("at this point in file"); - } - else - error ("too few arguments to function"); + if (complain & tf_error) + { + if (fndecl) + { + error ("too few arguments to %s %q+#D", + called_thing, fndecl); + error ("at this point in file"); + } + else + error ("too few arguments to function"); + } return -1; } } @@ -2985,7 +3100,8 @@ convert_arguments (int nargs, tree *argarray, tree build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, - tree arg2, enum tree_code arg2_code, bool *overloaded_p) + tree arg2, enum tree_code arg2_code, bool *overloaded_p, + tsubst_flags_t complain) { tree orig_arg1; tree orig_arg2; @@ -3007,7 +3123,7 @@ build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, expr = build_m_component_ref (arg1, arg2); else expr = build_new_op (code, LOOKUP_NORMAL, arg1, arg2, NULL_TREE, - overloaded_p); + overloaded_p, complain); /* Check for cases such as x+y<<z which users are likely to misinterpret. But don't warn about obj << x + y, since that is a @@ -3026,6 +3142,15 @@ build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, return expr; } +/* For the c-common bits. */ +tree +build_binary_op (enum tree_code code, tree op0, tree op1, + int convert_p ATTRIBUTE_UNUSED) +{ + return cp_build_binary_op(code, op0, op1, tf_warning_or_error); +} + + /* Build a binary-operation expression without default conversions. CODE is the kind of expression to build. This function differs from `build' in several ways: @@ -3045,8 +3170,8 @@ build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, multiple inheritance, and deal with pointer to member functions. */ tree -build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, - int convert_p ATTRIBUTE_UNUSED) +cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, + tsubst_flags_t complain) { tree op0, op1; enum tree_code code0, code1; @@ -3127,8 +3252,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree t = instantiate_type (TREE_TYPE (op1), op0, tf_none); if (t != error_mark_node) { - pedwarn ("assuming cast to type %qT from overloaded function", - TREE_TYPE (t)); + if (complain & tf_error) + pedwarn ("assuming cast to type %qT from overloaded function", + TREE_TYPE (t)); op0 = t; } } @@ -3137,8 +3263,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree t = instantiate_type (TREE_TYPE (op0), op1, tf_none); if (t != error_mark_node) { - pedwarn ("assuming cast to type %qT from overloaded function", - TREE_TYPE (t)); + if (complain & tf_error) + pedwarn ("assuming cast to type %qT from overloaded function", + TREE_TYPE (t)); op1 = t; } } @@ -3288,10 +3415,14 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning (0, "right shift count is negative"); + { + if (complain & tf_warning) + warning (0, "right shift count is negative"); + } else { - if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) + if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0 + && (complain & tf_warning)) warning (0, "right shift count >= width of type"); } } @@ -3311,9 +3442,15 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning (0, "left shift count is negative"); + { + if (complain & tf_warning) + warning (0, "left shift count is negative"); + } else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning (0, "left shift count >= width of type"); + { + if (complain & tf_warning) + warning (0, "left shift count >= width of type"); + } } /* Convert the shift-count to an integer, regardless of size of value being shifted. */ @@ -3332,13 +3469,19 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning (0, (code == LROTATE_EXPR) - ? G_("left rotate count is negative") - : G_("right rotate count is negative")); + { + if (complain & tf_warning) + warning (0, (code == LROTATE_EXPR) + ? G_("left rotate count is negative") + : G_("right rotate count is negative")); + } else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning (0, (code == LROTATE_EXPR) - ? G_("left rotate count >= width of type") - : G_("right rotate count >= width of type")); + { + if (complain & tf_warning) + warning (0, (code == LROTATE_EXPR) + ? G_("left rotate count >= width of type") + : G_("right rotate count >= width of type")); + } } /* Convert the shift-count to an integer, regardless of size of value being shifted. */ @@ -3349,11 +3492,13 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case EQ_EXPR: case NE_EXPR: - if (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1)) + if ((complain & tf_warning) + && (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1))) warning (OPT_Wfloat_equal, "comparing floating point with == or != is unsafe"); - if ((TREE_CODE (orig_op0) == STRING_CST && !integer_zerop (op1)) - || (TREE_CODE (orig_op1) == STRING_CST && !integer_zerop (op0))) + if ((complain & tf_warning) + && ((TREE_CODE (orig_op0) == STRING_CST && !integer_zerop (op1)) + || (TREE_CODE (orig_op1) == STRING_CST && !integer_zerop (op0)))) warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour"); build_type = boolean_type_node; @@ -3365,14 +3510,17 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE) || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1))) result_type = composite_pointer_type (type0, type1, op0, op1, - "comparison"); + "comparison", complain); else if ((code0 == POINTER_TYPE || TYPE_PTRMEM_P (type0)) && null_ptr_cst_p (op1)) { if (TREE_CODE (op0) == ADDR_EXPR && decl_with_nonnull_addr_p (TREE_OPERAND (op0, 0))) - warning (OPT_Waddress, "the address of %qD will never be NULL", - TREE_OPERAND (op0, 0)); + { + if (complain & tf_warning) + warning (OPT_Waddress, "the address of %qD will never be NULL", + TREE_OPERAND (op0, 0)); + } result_type = type0; } else if ((code1 == POINTER_TYPE || TYPE_PTRMEM_P (type1)) @@ -3380,19 +3528,28 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, { if (TREE_CODE (op1) == ADDR_EXPR && decl_with_nonnull_addr_p (TREE_OPERAND (op1, 0))) - warning (OPT_Waddress, "the address of %qD will never be NULL", - TREE_OPERAND (op1, 0)); + { + if (complain & tf_warning) + warning (OPT_Waddress, "the address of %qD will never be NULL", + TREE_OPERAND (op1, 0)); + } result_type = type1; } else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) { result_type = type0; - pedwarn ("ISO C++ forbids comparison between pointer and integer"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids comparison between pointer and integer"); + else + return error_mark_node; } else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE) { result_type = type1; - pedwarn ("ISO C++ forbids comparison between pointer and integer"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids comparison between pointer and integer"); + else + return error_mark_node; } else if (TYPE_PTRMEMFUNC_P (type0) && null_ptr_cst_p (op1)) { @@ -3404,12 +3561,16 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree e1 = cp_build_binary_op (EQ_EXPR, pfn0, fold_convert (TREE_TYPE (pfn0), - integer_zero_node)); + integer_zero_node), + complain); tree e2 = cp_build_binary_op (BIT_AND_EXPR, delta0, - integer_one_node); - e2 = cp_build_binary_op (EQ_EXPR, e2, integer_zero_node); - op0 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e2); + integer_one_node, + complain); + e2 = cp_build_binary_op (EQ_EXPR, e2, integer_zero_node, + complain); + op0 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e2, + complain); op1 = cp_convert (TREE_TYPE (op0), integer_one_node); } else @@ -3420,7 +3581,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, result_type = TREE_TYPE (op0); } else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (op0)) - return cp_build_binary_op (code, op1, op0); + return cp_build_binary_op (code, op1, op0, complain); else if (TYPE_PTRMEMFUNC_P (type0) && TYPE_PTRMEMFUNC_P (type1)) { tree type; @@ -3434,7 +3595,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree delta0; tree delta1; - type = composite_pointer_type (type0, type1, op0, op1, "comparison"); + type = composite_pointer_type (type0, type1, op0, op1, "comparison", + complain); if (!same_type_p (TREE_TYPE (op0), type)) op0 = cp_convert_and_check (type, op0); @@ -3469,20 +3631,26 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, e1 = cp_build_binary_op (BIT_AND_EXPR, delta0, - integer_one_node); - e1 = cp_build_binary_op (EQ_EXPR, e1, integer_zero_node); + integer_one_node, + complain); + e1 = cp_build_binary_op (EQ_EXPR, e1, integer_zero_node, + complain); e2 = cp_build_binary_op (BIT_AND_EXPR, delta1, - integer_one_node); - e2 = cp_build_binary_op (EQ_EXPR, e2, integer_zero_node); - e1 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1); + integer_one_node, + complain); + e2 = cp_build_binary_op (EQ_EXPR, e2, integer_zero_node, + complain); + e1 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1, + complain); e2 = cp_build_binary_op (EQ_EXPR, pfn0, fold_convert (TREE_TYPE (pfn0), - integer_zero_node)); - e2 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1); - e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1); - e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2); + integer_zero_node), + complain); + e2 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1, complain); + e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1, complain); + e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2, complain); } else { @@ -3495,18 +3663,19 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, pointer-to-member is any member with a zero PFN; the DELTA field is unspecified. */ - e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1); + e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1, complain); e2 = cp_build_binary_op (EQ_EXPR, pfn0, fold_convert (TREE_TYPE (pfn0), - integer_zero_node)); - e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2); + integer_zero_node), + complain); + e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2, complain); } e2 = build2 (EQ_EXPR, boolean_type_node, pfn0, pfn1); - e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1); + e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1, complain); if (code == EQ_EXPR) return e; - return cp_build_binary_op (EQ_EXPR, e, integer_zero_node); + return cp_build_binary_op (EQ_EXPR, e, integer_zero_node, complain); } else { @@ -3527,7 +3696,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, shorten = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) result_type = composite_pointer_type (type0, type1, op0, op1, - "comparison"); + "comparison", complain); break; case LE_EXPR: @@ -3536,7 +3705,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case GT_EXPR: if (TREE_CODE (orig_op0) == STRING_CST || TREE_CODE (orig_op1) == STRING_CST) - warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour"); + { + if (complain & tf_warning) + warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour"); + } build_type = boolean_type_node; if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) @@ -3544,7 +3716,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, short_compare = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) result_type = composite_pointer_type (type0, type1, op0, op1, - "comparison"); + "comparison", complain); else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1)) result_type = type0; @@ -3554,12 +3726,18 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) { result_type = type0; - pedwarn ("ISO C++ forbids comparison between pointer and integer"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids comparison between pointer and integer"); + else + return error_mark_node; } else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE) { result_type = type1; - pedwarn ("ISO C++ forbids comparison between pointer and integer"); + if (complain & tf_error) + pedwarn ("ISO C++ forbids comparison between pointer and integer"); + else + return error_mark_node; } break; @@ -3573,7 +3751,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, build_type = integer_type_node; if (code0 != REAL_TYPE || code1 != REAL_TYPE) { - error ("unordered comparison on non-floating point argument"); + if (complain & tf_error) + error ("unordered comparison on non-floating point argument"); return error_mark_node; } common = 1; @@ -3611,8 +3790,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (!result_type) { - error ("invalid operands of types %qT and %qT to binary %qO", - TREE_TYPE (orig_op0), TREE_TYPE (orig_op1), code); + if (complain & tf_error) + error ("invalid operands of types %qT and %qT to binary %qO", + TREE_TYPE (orig_op0), TREE_TYPE (orig_op1), code); return error_mark_node; } @@ -3742,7 +3922,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0)) - != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))) + != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)) + && (complain & tf_warning)) { warning (OPT_Wsign_compare, "comparison between types %q#T and %q#T", TREE_TYPE (orig_op0), TREE_TYPE (orig_op1)); @@ -3779,7 +3960,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && int_fits_type_p (orig_op0, c_common_signed_type (result_type))))) /* OK */; - else + else if (complain & tf_warning) warning (OPT_Wsign_compare, "comparison between signed and unsigned integer expressions"); @@ -3824,7 +4005,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && bits < HOST_BITS_PER_LONG && unsignedp) { mask = (~ (HOST_WIDE_INT) 0) << bits; - if ((mask & constant) != mask) + if ((mask & constant) != mask + && (complain & tf_warning)) warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with constant"); } } @@ -3832,7 +4014,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && (TYPE_PRECISION (TREE_TYPE (primop0)) < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) - < TYPE_PRECISION (result_type))) + < TYPE_PRECISION (result_type)) + && (complain & tf_warning)) warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with unsigned"); } } @@ -3848,7 +4031,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && code != EQ_EXPR && code != NE_EXPR) /* Or if one of OP0 or OP1 is neither a pointer nor NULL. */ || (!null_ptr_cst_p (orig_op0) && TREE_CODE (TREE_TYPE (op0)) != POINTER_TYPE) - || (!null_ptr_cst_p (orig_op1) && TREE_CODE (TREE_TYPE (op1)) != POINTER_TYPE))) + || (!null_ptr_cst_p (orig_op1) && TREE_CODE (TREE_TYPE (op1)) != POINTER_TYPE)) + && (complain & tf_warning)) /* Some sort of arithmetic operation involving NULL was performed. Note that pointer-difference and pointer-addition have already been handled above, and so we don't end up here in @@ -3934,7 +4118,8 @@ pointer_diff (tree op0, tree op1, tree ptrtype) op0 = cp_build_binary_op (MINUS_EXPR, cp_convert (restype, op0), - cp_convert (restype, op1)); + cp_convert (restype, op1), + tf_warning_or_error); /* This generates an error if op1 is a pointer to an incomplete type. */ if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (op1)))) @@ -3955,7 +4140,7 @@ pointer_diff (tree op0, tree op1, tree ptrtype) and XARG is the operand. */ tree -build_x_unary_op (enum tree_code code, tree xarg) +build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain) { tree orig_expr = xarg; tree exp; @@ -3987,7 +4172,7 @@ build_x_unary_op (enum tree_code code, tree xarg) /* Don't look for a function. */; else exp = build_new_op (code, LOOKUP_NORMAL, xarg, NULL_TREE, NULL_TREE, - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, complain); if (!exp && code == ADDR_EXPR) { /* A pointer to member-function can be formed only by saying @@ -3998,10 +4183,10 @@ build_x_unary_op (enum tree_code code, tree xarg) if (TREE_CODE (xarg) != OFFSET_REF || !TYPE_P (TREE_OPERAND (xarg, 0))) { - error ("invalid use of %qE to form a pointer-to-member-function", - xarg); - if (TREE_CODE (xarg) != OFFSET_REF) - inform (" a qualified-id is required"); + error ("invalid use of %qE to form a pointer-to-member-function", + xarg); + if (TREE_CODE (xarg) != OFFSET_REF) + inform (" a qualified-id is required"); return error_mark_node; } else @@ -4028,9 +4213,9 @@ build_x_unary_op (enum tree_code code, tree xarg) PTRMEM_OK_P (xarg) = ptrmem; } } - else if (TREE_CODE (xarg) == TARGET_EXPR) + else if (TREE_CODE (xarg) == TARGET_EXPR && (complain & tf_warning)) warning (0, "taking address of temporary"); - exp = build_unary_op (ADDR_EXPR, xarg, 0); + exp = cp_build_unary_op (ADDR_EXPR, xarg, 0, complain); } if (processing_template_decl && exp != error_mark_node) @@ -4063,7 +4248,8 @@ condition_conversion (tree expr) tree t; if (processing_template_decl) return expr; - t = perform_implicit_conversion (boolean_type_node, expr); + t = perform_implicit_conversion (boolean_type_node, expr, + tf_warning_or_error); t = fold_build_cleanup_point_expr (boolean_type_node, t); return t; } @@ -4105,7 +4291,8 @@ build_nop (tree type, tree expr) (such as from short to int). */ tree -build_unary_op (enum tree_code code, tree xarg, int noconvert) +cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, + tsubst_flags_t complain) { /* No default_conversion here. It causes trouble for ADDR_EXPR. */ tree arg = xarg; @@ -4184,7 +4371,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) break; case TRUTH_NOT_EXPR: - arg = perform_implicit_conversion (boolean_type_node, arg); + arg = perform_implicit_conversion (boolean_type_node, arg, + complain); val = invert_truthvalue (arg); if (arg != error_mark_node) return val; @@ -4234,9 +4422,9 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) tree real, imag; arg = stabilize_reference (arg); - real = build_unary_op (REALPART_EXPR, arg, 1); - imag = build_unary_op (IMAGPART_EXPR, arg, 1); - real = build_unary_op (code, real, 1); + real = cp_build_unary_op (REALPART_EXPR, arg, 1, complain); + imag = cp_build_unary_op (IMAGPART_EXPR, arg, 1, complain); + real = cp_build_unary_op (code, real, 1, complain); if (real == error_mark_node || imag == error_mark_node) return error_mark_node; return build2 (COMPLEX_EXPR, TREE_TYPE (arg), @@ -4264,10 +4452,15 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) /* Report something read-only. */ if (CP_TYPE_CONST_P (TREE_TYPE (arg)) - || TREE_READONLY (arg)) - readonly_error (arg, ((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? "increment" : "decrement")); + || TREE_READONLY (arg)) + { + if (complain & tf_error) + readonly_error (arg, ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) + ? "increment" : "decrement")); + else + return error_mark_node; + } { tree inc; @@ -4281,9 +4474,14 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) /* ARM $5.2.5 last annotation says this should be forbidden. */ if (TREE_CODE (argtype) == ENUMERAL_TYPE) - pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - ? G_("ISO C++ forbids incrementing an enum") - : G_("ISO C++ forbids decrementing an enum")); + { + if (complain & tf_error) + pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) + ? G_("ISO C++ forbids incrementing an enum") + : G_("ISO C++ forbids decrementing an enum")); + else + return error_mark_node; + } /* Compute the increment. */ @@ -4292,18 +4490,29 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) tree type = complete_type (TREE_TYPE (argtype)); if (!COMPLETE_OR_VOID_TYPE_P (type)) - error (((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR)) - ? G_("cannot increment a pointer to incomplete type %qT") - : G_("cannot decrement a pointer to incomplete type %qT"), - TREE_TYPE (argtype)); + { + if (complain & tf_error) + error (((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR)) + ? G_("cannot increment a pointer to incomplete type %qT") + : G_("cannot decrement a pointer to incomplete type %qT"), + TREE_TYPE (argtype)); + else + return error_mark_node; + } else if ((pedantic || warn_pointer_arith) - && !TYPE_PTROB_P (argtype)) - pedwarn ((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? G_("ISO C++ forbids incrementing a pointer of type %qT") - : G_("ISO C++ forbids decrementing a pointer of type %qT"), - argtype); + && !TYPE_PTROB_P (argtype)) + { + if (complain & tf_error) + pedwarn ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) + ? G_("ISO C++ forbids incrementing a pointer of type %qT") + : G_("ISO C++ forbids decrementing a pointer of type %qT"), + argtype); + else + return error_mark_node; + } + inc = cxx_sizeof_nowarn (TREE_TYPE (argtype)); } else @@ -4314,7 +4523,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) /* Complain about anything else that is not a true lvalue. */ if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - ? lv_increment : lv_decrement))) + ? lv_increment : lv_decrement), + complain)) return error_mark_node; /* Forbid using -- on `bool'. */ @@ -4322,8 +4532,9 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) { if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR) { - error ("invalid use of Boolean expression as operand " - "to %<operator--%>"); + if (complain & tf_error) + error ("invalid use of Boolean expression as operand " + "to %<operator--%>"); return error_mark_node; } val = boolean_increment (code, arg); @@ -4351,8 +4562,13 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) return arg; } else if (pedantic && DECL_MAIN_P (arg)) - /* ARM $3.4 */ - pedwarn ("ISO C++ forbids taking address of function %<::main%>"); + { + /* ARM $3.4 */ + if (complain & tf_error) + pedwarn ("ISO C++ forbids taking address of function %<::main%>"); + else + return error_mark_node; + } /* Let &* cancel out to simplify resulting code. */ if (TREE_CODE (arg) == INDIRECT_REF) @@ -4405,13 +4621,15 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) if (! flag_ms_extensions) { tree name = DECL_NAME (fn); - if (current_class_type - && TREE_OPERAND (arg, 0) == current_class_ref) - /* An expression like &memfn. */ - pedwarn ("ISO C++ forbids taking the address of an unqualified" - " or parenthesized non-static member function to form" - " a pointer to member function. Say %<&%T::%D%>", - base, name); + if (!(complain & tf_error)) + return error_mark_node; + else if (current_class_type + && TREE_OPERAND (arg, 0) == current_class_ref) + /* An expression like &memfn. */ + pedwarn ("ISO C++ forbids taking the address of an unqualified" + " or parenthesized non-static member function to form" + " a pointer to member function. Say %<&%T::%D%>", + base, name); else pedwarn ("ISO C++ forbids taking the address of a bound member" " function to form a pointer to member function." @@ -4437,8 +4655,16 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) case CONVERT_EXPR: case FLOAT_EXPR: case FIX_TRUNC_EXPR: - if (! lvalue_p (arg) && pedantic) - pedwarn ("ISO C++ forbids taking the address of a cast to a non-lvalue expression"); + /* Even if we're not being pedantic, we cannot allow this + extension when we're instantiating in a SFINAE + context. */ + if (! lvalue_p (arg) && (pedantic || complain == tf_none)) + { + if (complain & tf_error) + pedwarn ("ISO C++ forbids taking the address of a cast to a non-lvalue expression"); + else + return error_mark_node; + } break; case BASELINK: @@ -4457,12 +4683,13 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) tree t; if (!PTRMEM_OK_P (arg)) - return build_unary_op (code, arg, 0); + return cp_build_unary_op (code, arg, 0, complain); t = TREE_OPERAND (arg, 1); if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) { - error ("cannot create pointer to reference member %qD", t); + if (complain & tf_error) + error ("cannot create pointer to reference member %qD", t); return error_mark_node; } @@ -4481,7 +4708,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) if (TREE_CODE (argtype) != FUNCTION_TYPE && TREE_CODE (argtype) != METHOD_TYPE && TREE_CODE (arg) != OFFSET_REF - && !lvalue_or_else (arg, lv_addressof)) + && !lvalue_or_else (arg, lv_addressof, complain)) return error_mark_node; if (argtype != error_mark_node) @@ -4520,8 +4747,9 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) } else if (DECL_C_BIT_FIELD (TREE_OPERAND (arg, 1))) { - error ("attempt to take address of bit-field structure member %qD", - TREE_OPERAND (arg, 1)); + if (complain & tf_error) + error ("attempt to take address of bit-field structure member %qD", + TREE_OPERAND (arg, 1)); return error_mark_node; } else @@ -4554,10 +4782,18 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) return fold_if_not_in_template (build1 (code, argtype, arg)); } - error ("%s", errstring); + if (complain & tf_error) + error ("%s", errstring); return error_mark_node; } +/* Hook for the c-common bits that build a unary op. */ +tree +build_unary_op (enum tree_code code, tree xarg, int noconvert) +{ + return cp_build_unary_op (code, xarg, noconvert, tf_warning_or_error); +} + /* Apply unary lvalue-demanding operator CODE to the expression ARG for certain kinds of expressions which are not really lvalues but which we can accept as lvalues. @@ -4577,7 +4813,8 @@ unary_complex_lvalue (enum tree_code code, tree arg) /* Handle (a, b) used as an "lvalue". */ if (TREE_CODE (arg) == COMPOUND_EXPR) { - tree real_result = build_unary_op (code, TREE_OPERAND (arg, 1), 0); + tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 1), 0, + tf_warning_or_error); return build2 (COMPOUND_EXPR, TREE_TYPE (real_result), TREE_OPERAND (arg, 0), real_result); } @@ -4585,7 +4822,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) /* Handle (a ? b : c) used as an "lvalue". */ if (TREE_CODE (arg) == COND_EXPR || TREE_CODE (arg) == MIN_EXPR || TREE_CODE (arg) == MAX_EXPR) - return rationalize_conditional_expr (code, arg); + return rationalize_conditional_expr (code, arg, tf_warning_or_error); /* Handle (a = b), (++a), and (--a) used as an "lvalue". */ if (TREE_CODE (arg) == MODIFY_EXPR @@ -4610,7 +4847,8 @@ unary_complex_lvalue (enum tree_code code, tree arg) if (TREE_CODE (arg) == MODIFY_EXPR || TREE_CODE (arg) == INIT_EXPR) { - tree real_result = build_unary_op (code, TREE_OPERAND (arg, 0), 0); + tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 0), 0, + tf_warning_or_error); arg = build2 (COMPOUND_EXPR, TREE_TYPE (real_result), arg, real_result); TREE_NO_WARNING (arg) = 1; @@ -4727,7 +4965,8 @@ cxx_mark_addressable (tree exp) /* Build and return a conditional expression IFEXP ? OP1 : OP2. */ tree -build_x_conditional_expr (tree ifexp, tree op1, tree op2) +build_x_conditional_expr (tree ifexp, tree op1, tree op2, + tsubst_flags_t complain) { tree orig_ifexp = ifexp; tree orig_op1 = op1; @@ -4750,7 +4989,7 @@ build_x_conditional_expr (tree ifexp, tree op1, tree op2) op2 = build_non_dependent_expr (op2); } - expr = build_conditional_expr (ifexp, op1, op2); + expr = build_conditional_expr (ifexp, op1, op2, complain); if (processing_template_decl && expr != error_mark_node) return build_min_non_dep (COND_EXPR, expr, orig_ifexp, orig_op1, orig_op2); @@ -4770,7 +5009,8 @@ tree build_x_compound_expr_from_list (tree list, const char *msg) pedwarn ("%s expression list treated as compound expression", msg); for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list)) - expr = build_x_compound_expr (expr, TREE_VALUE (list)); + expr = build_x_compound_expr (expr, TREE_VALUE (list), + tf_warning_or_error); } return expr; @@ -4779,7 +5019,7 @@ tree build_x_compound_expr_from_list (tree list, const char *msg) /* Handle overloading of the ',' operator when needed. */ tree -build_x_compound_expr (tree op1, tree op2) +build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) { tree result; tree orig_op1 = op1; @@ -4795,9 +5035,9 @@ build_x_compound_expr (tree op1, tree op2) } result = build_new_op (COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2, NULL_TREE, - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, complain); if (!result) - result = build_compound_expr (op1, op2); + result = build_compound_expr (op1, op2, complain); if (processing_template_decl && result != error_mark_node) return build_min_non_dep (COMPOUND_EXPR, result, orig_op1, orig_op2); @@ -4808,9 +5048,9 @@ build_x_compound_expr (tree op1, tree op2) /* Build a compound expression. */ tree -build_compound_expr (tree lhs, tree rhs) +build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain) { - lhs = convert_to_void (lhs, "left-hand operand of comma"); + lhs = convert_to_void (lhs, "left-hand operand of comma", complain); if (lhs == error_mark_node || rhs == error_mark_node) return error_mark_node; @@ -4893,9 +5133,11 @@ convert_ptrmem (tree type, tree expr, bool allow_inverse_p, cond = cp_build_binary_op (EQ_EXPR, expr, - build_int_cst (TREE_TYPE (expr), -1)); + build_int_cst (TREE_TYPE (expr), -1), + tf_warning_or_error); op1 = build_nop (ptrdiff_type_node, expr); - op2 = cp_build_binary_op (PLUS_EXPR, op1, delta); + op2 = cp_build_binary_op (PLUS_EXPR, op1, delta, + tf_warning_or_error); expr = fold_build3 (COND_EXPR, ptrdiff_type_node, cond, op1, op2); @@ -4944,7 +5186,7 @@ ignore_overflows (tree expr, tree orig) static tree build_static_cast_1 (tree type, tree expr, bool c_cast_p, - bool *valid_p) + bool *valid_p, tsubst_flags_t complain) { tree intype; tree result; @@ -5018,7 +5260,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, t(e);" is well-formed, for some invented temporary variable t. */ result = perform_direct_initialization_if_possible (type, expr, - c_cast_p); + c_cast_p, complain); if (result) { result = convert_from_reference (result); @@ -5039,7 +5281,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, Any expression can be explicitly converted to type cv void. */ if (TREE_CODE (type) == VOID_TYPE) - return convert_to_void (expr, /*implicit=*/NULL); + return convert_to_void (expr, /*implicit=*/NULL, complain); /* [expr.static.cast] @@ -5145,7 +5387,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, /* Return an expression representing static_cast<TYPE>(EXPR). */ tree -build_static_cast (tree type, tree expr) +build_static_cast (tree type, tree expr, tsubst_flags_t complain) { tree result; bool valid_p; @@ -5168,12 +5410,14 @@ build_static_cast (tree type, tree expr) && TREE_TYPE (expr) == TREE_TYPE (TREE_OPERAND (expr, 0))) expr = TREE_OPERAND (expr, 0); - result = build_static_cast_1 (type, expr, /*c_cast_p=*/false, &valid_p); + result = build_static_cast_1 (type, expr, /*c_cast_p=*/false, &valid_p, + complain); if (valid_p) return result; - error ("invalid static_cast from type %qT to type %qT", - TREE_TYPE (expr), type); + if (complain & tf_error) + error ("invalid static_cast from type %qT to type %qT", + TREE_TYPE (expr), type); return error_mark_node; } @@ -5217,7 +5461,7 @@ convert_member_func_to_ptr (tree type, tree expr) static tree build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, - bool *valid_p) + bool *valid_p, tsubst_flags_t complain) { tree intype; @@ -5242,9 +5486,10 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, { if (! real_lvalue_p (expr)) { - error ("invalid cast of an rvalue expression of type " - "%qT to type %qT", - intype, type); + if (complain & tf_error) + error ("invalid cast of an rvalue expression of type " + "%qT to type %qT", + intype, type); return error_mark_node; } @@ -5252,18 +5497,19 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, "B" are related class types; the reinterpret_cast does not adjust the pointer. */ if (TYPE_PTR_P (intype) + && (complain & tf_warning) && (comptypes (TREE_TYPE (intype), TREE_TYPE (type), COMPARE_BASE | COMPARE_DERIVED))) warning (0, "casting %qT to %qT does not dereference pointer", intype, type); - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain); if (expr != error_mark_node) expr = build_reinterpret_cast_1 (build_pointer_type (TREE_TYPE (type)), expr, c_cast_p, - valid_p); + valid_p, complain); if (expr != error_mark_node) - expr = build_indirect_ref (expr, 0); + expr = cp_build_indirect_ref (expr, 0, complain); return expr; } @@ -5301,8 +5547,13 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, if (CP_INTEGRAL_TYPE_P (type) && TYPE_PTR_P (intype)) { if (TYPE_PRECISION (type) < TYPE_PRECISION (intype)) - pedwarn ("cast from %qT to %qT loses precision", - intype, type); + { + if (complain & tf_error) + pedwarn ("cast from %qT to %qT loses precision", + intype, type); + else + return error_mark_node; + } } /* [expr.reinterpret.cast] A value of integral or enumeration type can be explicitly @@ -5322,6 +5573,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, check_for_casting_away_constness (intype, type, REINTERPRET_CAST_EXPR); /* Warn about possible alignment problems. */ if (STRICT_ALIGNMENT && warn_cast_align + && (complain & tf_warning) && !VOID_TYPE_P (type) && TREE_CODE (TREE_TYPE (intype)) != FUNCTION_TYPE && COMPLETE_TYPE_P (TREE_TYPE (type)) @@ -5341,7 +5593,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, else if ((TYPE_PTRFN_P (type) && TYPE_PTROBV_P (intype)) || (TYPE_PTRFN_P (intype) && TYPE_PTROBV_P (type))) { - if (pedantic) + if (pedantic && (complain & tf_warning)) /* Only issue a warning, as we have always supported this where possible, and it is necessary in some cases. DR 195 addresses this issue, but as of 2004/10/26 is still in @@ -5357,7 +5609,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, { if (valid_p) *valid_p = false; - error ("invalid cast from type %qT to type %qT", intype, type); + if (complain & tf_error) + error ("invalid cast from type %qT to type %qT", intype, type); return error_mark_node; } @@ -5365,7 +5618,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, } tree -build_reinterpret_cast (tree type, tree expr) +build_reinterpret_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || expr == error_mark_node) return error_mark_node; @@ -5382,7 +5635,7 @@ build_reinterpret_cast (tree type, tree expr) } return build_reinterpret_cast_1 (type, expr, /*c_cast_p=*/false, - /*valid_p=*/NULL); + /*valid_p=*/NULL, complain); } /* Perform a const_cast from EXPR to TYPE. If the cast is valid, @@ -5477,7 +5730,8 @@ build_const_cast_1 (tree dst_type, tree expr, bool complain, } if (reference_type) { - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, + complain? tf_warning_or_error : tf_none); expr = build_nop (reference_type, expr); return convert_from_reference (expr); } @@ -5501,7 +5755,7 @@ build_const_cast_1 (tree dst_type, tree expr, bool complain, } tree -build_const_cast (tree type, tree expr) +build_const_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || error_operand_p (expr)) return error_mark_node; @@ -5517,7 +5771,7 @@ build_const_cast (tree type, tree expr) return convert_from_reference (t); } - return build_const_cast_1 (type, expr, /*complain=*/true, + return build_const_cast_1 (type, expr, complain & tf_error, /*valid_p=*/NULL); } @@ -5525,7 +5779,7 @@ build_const_cast (tree type, tree expr) TYPE of expression EXPR. */ tree -build_c_cast (tree type, tree expr) +build_c_cast (tree type, tree expr, tsubst_flags_t complain) { tree value = expr; tree result; @@ -5563,12 +5817,16 @@ build_c_cast (tree type, tree expr) NIHCL uses it. It is not valid ISO C++ however. */ if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE) { - pedwarn ("ISO C++ forbids casting to an array type %qT", type); + if (complain & tf_error) + pedwarn ("ISO C++ forbids casting to an array type %qT", type); + else + return error_mark_node; type = build_pointer_type (TREE_TYPE (type)); } else { - error ("ISO C++ forbids casting to an array type %qT", type); + if (complain & tf_error) + error ("ISO C++ forbids casting to an array type %qT", type); return error_mark_node; } } @@ -5576,7 +5834,8 @@ build_c_cast (tree type, tree expr) if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE) { - error ("invalid cast to function type %qT", type); + if (complain & tf_error) + error ("invalid cast to function type %qT", type); return error_mark_node; } @@ -5588,11 +5847,11 @@ build_c_cast (tree type, tree expr) /* Or a static cast. */ result = build_static_cast_1 (type, value, /*c_cast_p=*/true, - &valid_p); + &valid_p, complain); /* Or a reinterpret_cast. */ if (!valid_p) result = build_reinterpret_cast_1 (type, value, /*c_cast_p=*/true, - &valid_p); + &valid_p, complain); /* The static_cast or reinterpret_cast may be followed by a const_cast. */ if (valid_p @@ -5624,6 +5883,13 @@ build_c_cast (tree type, tree expr) return error_mark_node; } +/* For use from the C common bits. */ +tree +build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) +{ + return cp_build_modify_expr (lhs, modifycode, rhs, tf_warning_or_error); +} + /* Build an assignment expression of lvalue LHS from value RHS. MODIFYCODE is the code for a binary operator that we use to combine the old value of LHS with RHS to get the new value. @@ -5632,7 +5898,8 @@ build_c_cast (tree type, tree expr) C++: If MODIFYCODE is INIT_EXPR, then leave references unbashed. */ tree -build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) +cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, + tsubst_flags_t complain) { tree result; tree newrhs = rhs; @@ -5657,13 +5924,13 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) TREE_OPERAND (lhs, 1)); return build2 (COMPOUND_EXPR, lhstype, lhs, - build_modify_expr (TREE_OPERAND (lhs, 0), - modifycode, rhs)); + cp_build_modify_expr (TREE_OPERAND (lhs, 0), + modifycode, rhs, complain)); /* Handle (a, b) used as an "lvalue". */ case COMPOUND_EXPR: - newrhs = build_modify_expr (TREE_OPERAND (lhs, 1), - modifycode, rhs); + newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 1), + modifycode, rhs, complain); if (newrhs == error_mark_node) return error_mark_node; return build2 (COMPOUND_EXPR, lhstype, @@ -5674,7 +5941,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs), stabilize_reference (TREE_OPERAND (lhs, 0)), TREE_OPERAND (lhs, 1)); - newrhs = build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs); + newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs, + complain); if (newrhs == error_mark_node) return error_mark_node; return build2 (COMPOUND_EXPR, lhstype, lhs, newrhs); @@ -5683,7 +5951,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) case MAX_EXPR: /* MIN_EXPR and MAX_EXPR are currently only permitted as lvalues, when neither operand has side-effects. */ - if (!lvalue_or_else (lhs, lv_assign)) + if (!lvalue_or_else (lhs, lv_assign, complain)) return error_mark_node; gcc_assert (!TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)) @@ -5709,7 +5977,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (VOID_TYPE_P (TREE_TYPE (rhs))) { - error ("void value not ignored as it ought to be"); + if (complain & tf_error) + error ("void value not ignored as it ought to be"); return error_mark_node; } @@ -5717,15 +5986,16 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) /* Check this here to avoid odd errors when trying to convert a throw to the type of the COND_EXPR. */ - if (!lvalue_or_else (lhs, lv_assign)) + if (!lvalue_or_else (lhs, lv_assign, complain)) return error_mark_node; cond = build_conditional_expr (TREE_OPERAND (lhs, 0), - build_modify_expr (TREE_OPERAND (lhs, 1), - modifycode, rhs), - build_modify_expr (TREE_OPERAND (lhs, 2), - modifycode, rhs)); + cp_build_modify_expr (TREE_OPERAND (lhs, 1), + modifycode, rhs, complain), + cp_build_modify_expr (TREE_OPERAND (lhs, 2), + modifycode, rhs, complain), + complain); if (cond == error_mark_node) return cond; @@ -5757,7 +6027,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { result = build_special_member_call (lhs, complete_ctor_identifier, build_tree_list (NULL_TREE, rhs), - lhstype, LOOKUP_NORMAL); + lhstype, LOOKUP_NORMAL, + complain); if (result == NULL_TREE) return error_mark_node; return result; @@ -5778,7 +6049,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { result = build_new_op (MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, make_node (NOP_EXPR), - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, + complain); if (result == NULL_TREE) return error_mark_node; return result; @@ -5795,11 +6067,13 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) || MAYBE_CLASS_TYPE_P (lhstype))); lhs = stabilize_reference (lhs); - newrhs = cp_build_binary_op (modifycode, lhs, rhs); + newrhs = cp_build_binary_op (modifycode, lhs, rhs, + complain); if (newrhs == error_mark_node) { - error (" in evaluation of %<%Q(%#T, %#T)%>", modifycode, - TREE_TYPE (lhs), TREE_TYPE (rhs)); + if (complain & tf_error) + error (" in evaluation of %<%Q(%#T, %#T)%>", modifycode, + TREE_TYPE (lhs), TREE_TYPE (rhs)); return error_mark_node; } @@ -5811,7 +6085,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) } /* The left-hand side must be an lvalue. */ - if (!lvalue_or_else (lhs, lv_assign)) + if (!lvalue_or_else (lhs, lv_assign, complain)) return error_mark_node; /* Warn about modifying something that is `const'. Don't warn if @@ -5826,7 +6100,12 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) effectively const. */ || (CLASS_TYPE_P (lhstype) && C_TYPE_FIELDS_READONLY (lhstype)))) - readonly_error (lhs, "assignment"); + { + if (complain & tf_error) + readonly_error (lhs, "assignment"); + else + return error_mark_node; + } /* If storing into a structure or union member, it has probably been given type `int'. Compute the type that would go with the actual @@ -5867,8 +6146,9 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype), TYPE_MAIN_VARIANT (TREE_TYPE (rhs)))) { - error ("incompatible types in assignment of %qT to %qT", - TREE_TYPE (rhs), lhstype); + if (complain & tf_error) + error ("incompatible types in assignment of %qT to %qT", + TREE_TYPE (rhs), lhstype); return error_mark_node; } @@ -5877,10 +6157,13 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { /* This routine is used for both initialization and assignment. Make sure the diagnostic message differentiates the context. */ - if (modifycode == INIT_EXPR) - error ("array used as initializer"); - else - error ("invalid array assignment"); + if (complain & tf_error) + { + if (modifycode == INIT_EXPR) + error ("array used as initializer"); + else + error ("invalid array assignment"); + } return error_mark_node; } @@ -5888,12 +6171,13 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) ? 1 + (modifycode != INIT_EXPR): 0; return build_vec_init (lhs, NULL_TREE, newrhs, /*explicit_default_init_p=*/false, - from_array); + from_array, complain); } if (modifycode == INIT_EXPR) newrhs = convert_for_initialization (lhs, lhstype, newrhs, LOOKUP_NORMAL, - "initialization", NULL_TREE, 0); + "initialization", NULL_TREE, 0, + complain); else { /* Avoid warnings on enum bit fields. */ @@ -5901,12 +6185,12 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) && TREE_CODE (lhstype) == INTEGER_TYPE) { newrhs = convert_for_assignment (olhstype, newrhs, "assignment", - NULL_TREE, 0); + NULL_TREE, 0, complain); newrhs = convert_force (lhstype, newrhs, 0); } else newrhs = convert_for_assignment (lhstype, newrhs, "assignment", - NULL_TREE, 0); + NULL_TREE, 0, complain); if (TREE_CODE (newrhs) == CALL_EXPR && TYPE_NEEDS_CONSTRUCTING (lhstype)) newrhs = build_cplus_new (lhstype, newrhs); @@ -5952,11 +6236,12 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) return result; } return convert_for_assignment (olhstype, result, "assignment", - NULL_TREE, 0); + NULL_TREE, 0, complain); } tree -build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) +build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, + tsubst_flags_t complain) { if (processing_template_decl) return build_min_nt (MODOP_EXPR, lhs, @@ -5966,14 +6251,15 @@ build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) { tree rval = build_new_op (MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, make_node (modifycode), - /*overloaded_p=*/NULL); + /*overloaded_p=*/NULL, + complain); if (rval) { TREE_NO_WARNING (rval) = 1; return rval; } } - return build_modify_expr (lhs, modifycode, rhs); + return cp_build_modify_expr (lhs, modifycode, rhs, complain); } /* Helper function for get_delta_difference which assumes FROM is a base @@ -6151,7 +6437,8 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p) if (same_type_p (to_type, pfn_type)) return pfn; else if (integer_zerop (n)) - return build_reinterpret_cast (to_type, pfn); + return build_reinterpret_cast (to_type, pfn, + tf_warning_or_error); } if (TREE_SIDE_EFFECTS (pfn)) @@ -6170,15 +6457,16 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p) gcc_assert (same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (delta), ptrdiff_type_node)); if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta) - n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node); - delta = cp_build_binary_op (PLUS_EXPR, delta, n); + n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node, + tf_warning_or_error); + delta = cp_build_binary_op (PLUS_EXPR, delta, n, tf_warning_or_error); return build_ptrmemfunc1 (to_type, delta, npfn); } /* Handle null pointer to member function conversions. */ if (integer_zerop (pfn)) { - pfn = build_c_cast (type, integer_zero_node); + pfn = build_c_cast (type, integer_zero_node, tf_warning_or_error); return build_ptrmemfunc1 (to_type, integer_zero_node, pfn); @@ -6314,7 +6602,8 @@ delta_from_ptrmemfunc (tree t) static tree convert_for_assignment (tree type, tree rhs, - const char *errtype, tree fndecl, int parmnum) + const char *errtype, tree fndecl, int parmnum, + tsubst_flags_t complain) { tree rhstype; enum tree_code coder; @@ -6338,7 +6627,8 @@ convert_for_assignment (tree type, tree rhs, /* The RHS of an assignment cannot have void type. */ if (coder == VOID_TYPE) { - error ("void value not ignored as it ought to be"); + if (complain & tf_error) + error ("void value not ignored as it ought to be"); return error_mark_node; } @@ -6391,16 +6681,20 @@ convert_for_assignment (tree type, tree rhs, rhs = cp_convert (strip_top_quals (type), rhs); else { - /* If the right-hand side has unknown type, then it is an - overloaded function. Call instantiate_type to get error - messages. */ - if (rhstype == unknown_type_node) - instantiate_type (type, rhs, tf_warning_or_error); - else if (fndecl) - error ("cannot convert %qT to %qT for argument %qP to %qD", - rhstype, type, parmnum, fndecl); - else - error ("cannot convert %qT to %qT in %s", rhstype, type, errtype); + if (complain & tf_error) + { + /* If the right-hand side has unknown type, then it is an + overloaded function. Call instantiate_type to get error + messages. */ + if (rhstype == unknown_type_node) + instantiate_type (type, rhs, tf_warning_or_error); + else if (fndecl) + error ("cannot convert %qT to %qT for argument %qP to %qD", + rhstype, type, parmnum, fndecl); + else + error ("cannot convert %qT to %qT in %s", rhstype, type, + errtype); + } return error_mark_node; } } @@ -6409,7 +6703,8 @@ convert_for_assignment (tree type, tree rhs, const enum tree_code codel = TREE_CODE (type); if ((codel == POINTER_TYPE || codel == REFERENCE_TYPE) && coder == codel - && check_missing_format_attribute (type, rhstype)) + && check_missing_format_attribute (type, rhstype) + && (complain & tf_warning)) warning (OPT_Wmissing_format_attribute, "%s might be a candidate for a format attribute", errtype); @@ -6421,14 +6716,15 @@ convert_for_assignment (tree type, tree rhs, && type == boolean_type_node && TREE_CODE (rhs) == MODIFY_EXPR && !TREE_NO_WARNING (rhs) - && TREE_TYPE (rhs) != boolean_type_node) + && TREE_TYPE (rhs) != boolean_type_node + && (complain & tf_warning)) { warning (OPT_Wparentheses, "suggest parentheses around assignment used as truth value"); TREE_NO_WARNING (rhs) = 1; } - return perform_implicit_conversion (strip_top_quals (type), rhs); + return perform_implicit_conversion (strip_top_quals (type), rhs, complain); } /* Convert RHS to be of type TYPE. @@ -6449,7 +6745,8 @@ convert_for_assignment (tree type, tree rhs, tree convert_for_initialization (tree exp, tree type, tree rhs, int flags, - const char *errtype, tree fndecl, int parmnum) + const char *errtype, tree fndecl, int parmnum, + tsubst_flags_t complain) { enum tree_code codel = TREE_CODE (type); tree rhstype; @@ -6517,7 +6814,8 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags, if (MAYBE_CLASS_TYPE_P (type)) return ocp_convert (type, rhs, CONV_IMPLICIT|CONV_FORCE_TEMP, flags); - return convert_for_assignment (type, rhs, errtype, fndecl, parmnum); + return convert_for_assignment (type, rhs, errtype, fndecl, parmnum, + complain); } /* If RETVAL is the address of, or a reference to, a local variable or @@ -6810,7 +7108,8 @@ check_return_expr (tree retval, bool *no_warning) to the type of return value's location to handle the case that functype is smaller than the valtype. */ retval = convert_for_initialization - (NULL_TREE, functype, retval, flags, "return", NULL_TREE, 0); + (NULL_TREE, functype, retval, flags, "return", NULL_TREE, 0, + tf_warning_or_error); retval = convert (valtype, retval); /* If the conversion failed, treat this just like `return;'. */ @@ -7174,11 +7473,11 @@ non_reference (tree t) how the lvalue is being used and so selects the error message. */ int -lvalue_or_else (const_tree ref, enum lvalue_use use) +lvalue_or_else (const_tree ref, enum lvalue_use use, tsubst_flags_t complain) { int win = lvalue_p (ref); - if (!win) + if (!win && (complain & tf_error)) lvalue_error (use); return win; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index c48a7852609..4fdb07ff0b9 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -707,7 +707,8 @@ digest_init (tree type, tree init) tree *exp; init = convert_for_initialization (0, type, init, LOOKUP_NORMAL, - "initialization", NULL_TREE, 0); + "initialization", NULL_TREE, 0, + tf_warning_or_error); exp = &init; /* Skip any conversions since we'll be outputting the underlying @@ -751,7 +752,8 @@ digest_init (tree type, tree init) return convert_for_initialization (NULL_TREE, type, init, LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING, - "initialization", NULL_TREE, 0); + "initialization", NULL_TREE, 0, + tf_warning_or_error); } } @@ -849,7 +851,8 @@ process_init_constructor_array (tree type, tree init) TARGET_EXPRs. If the type in question is a class, just build one up; if it's an array, recurse. */ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (type))) - next = build_functional_cast (TREE_TYPE (type), NULL_TREE); + next = build_functional_cast (TREE_TYPE (type), NULL_TREE, + tf_warning_or_error); else next = build_constructor (NULL_TREE, NULL); next = digest_init (TREE_TYPE (type), next); @@ -936,7 +939,8 @@ process_init_constructor_record (tree type, tree init) for us, so build up TARGET_EXPRs. If the type in question is a class, just build one up; if it's an array, recurse. */ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (field))) - next = build_functional_cast (TREE_TYPE (field), NULL_TREE); + next = build_functional_cast (TREE_TYPE (field), NULL_TREE, + tf_warning_or_error); else next = build_constructor (NULL_TREE, NULL); @@ -1165,7 +1169,8 @@ build_x_arrow (tree expr) { while ((expr = build_new_op (COMPONENT_REF, LOOKUP_NORMAL, expr, NULL_TREE, NULL_TREE, - /*overloaded_p=*/NULL))) + /*overloaded_p=*/NULL, + tf_warning_or_error))) { if (expr == error_mark_node) return error_mark_node; @@ -1205,7 +1210,7 @@ build_x_arrow (tree expr) return expr; } - return build_indirect_ref (last_rval, NULL); + return cp_build_indirect_ref (last_rval, NULL, tf_warning_or_error); } if (types_memoized) @@ -1297,7 +1302,7 @@ build_m_component_ref (tree datum, tree component) datum = build2 (POINTER_PLUS_EXPR, ptype, fold_convert (ptype, datum), build_nop (sizetype, component)); - return build_indirect_ref (datum, 0); + return cp_build_indirect_ref (datum, 0, tf_warning_or_error); } else return build2 (OFFSET_REF, type, datum, component); @@ -1306,7 +1311,7 @@ build_m_component_ref (tree datum, tree component) /* Return a tree node for the expression TYPENAME '(' PARMS ')'. */ tree -build_functional_cast (tree exp, tree parms) +build_functional_cast (tree exp, tree parms, tsubst_flags_t complain) { /* This is either a call to a constructor, or a C cast in C++'s `functional' notation. */ @@ -1337,7 +1342,7 @@ build_functional_cast (tree exp, tree parms) /* This must build a C cast. */ parms = build_x_compound_expr_from_list (parms, "functional cast"); - return build_c_cast (type, parms); + return build_c_cast (type, parms, complain); } /* Prepare to evaluate as a call to a constructor. If this expression @@ -1358,7 +1363,7 @@ build_functional_cast (tree exp, tree parms) conversion is equivalent (in definedness, and if defined in meaning) to the corresponding cast expression. */ if (parms && TREE_CHAIN (parms) == NULL_TREE) - return build_c_cast (type, TREE_VALUE (parms)); + return build_c_cast (type, TREE_VALUE (parms), complain); /* [expr.type.conv] @@ -1378,7 +1383,7 @@ build_functional_cast (tree exp, tree parms) /* Call the constructor. */ exp = build_special_member_call (NULL_TREE, complete_ctor_identifier, parms, - type, LOOKUP_NORMAL); + type, LOOKUP_NORMAL, complain); if (exp == error_mark_node) return error_mark_node; diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b28d9dfd35d..1fa7fc2bcf7 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2299,16 +2299,33 @@ is used. @xref{C Dialect Options,,Options Controlling C Dialect}. @item function_vector -@cindex calling functions through the function vector on H8/300, M16C, and M32C processors +@cindex calling functions through the function vector on H8/300, M16C, M32C and SH2A processors Use this attribute on the H8/300, H8/300H, and H8S to indicate that the specified function should be called through the function vector. Calling a function through the function vector will reduce code size, however; the function vector has a limited size (maximum 128 entries on the H8/300 and 64 entries on the H8/300H and H8S) and shares space with the interrupt vector. +In SH2A target, this attribute declares a function to be called using the +TBR relative addressing mode. The argument to this attribute is the entry +number of the same function in a vector table containing all the TBR +relative addressable functions. For the successful jump, register TBR +should contain the start address of this TBR relative vector table. +In the startup routine of the user application, user needs to care of this +TBR register initialization. The TBR relative vector table can have at +max 256 function entries. The jumps to these functions will be generated +using a SH2A specific, non delayed branch instruction JSR/N @@(disp8,TBR). You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +Please refer the example of M16C target, to see the use of this +attribute while declaring a function, + +In an application, for a function being called once, this attribute will +save at least 8 bytes of code; and if other successive calls are being +made to the same function, it will save 2 bytes of code per each of these +calls. + On M16C/M32C targets, the @code{function_vector} attribute declares a special page subroutine call function. Use of this attribute reduces the code size by 2 bytes for each call generated to the @@ -2722,6 +2739,19 @@ number of registers available if used in conjunction with the attribute is incompatible with nested functions; this is considered a hard error. +@item resbank +@cindex @code{resbank} attribute +On the SH2A target, this attribute enables the high-speed register +saving and restoration using a register bank for @code{interrupt_handler} +routines. Saving to the bank is performed automatcially after the CPU +accepts an interrupt that uses a register bank. + +The nineteen 32-bit registers comprising general register R0 to R14, +control register GBR, and system registers MACH, MACL, and PR and the +vector table address offset are saved into a register bank. Register +banks are stacked in first-in last-out (FILO) sequence. Restoration +from the bank is executed by issuing a RESBANK instruction. + @item returns_twice @cindex @code{returns_twice} attribute The @code{returns_twice} attribute tells the compiler that a function may diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 45d982c52eb..027b1692bd9 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -285,7 +285,7 @@ requirements. Necessary to uncompress GCC @command{tar} files when source code is obtained via FTP mirror sites. -@item GNU make version 3.79.1 (or later) +@item GNU make version 3.80 (or later) You must have GNU make installed to build GCC@. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index d4b77534567..9cf3e0daa0d 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -642,6 +642,11 @@ all generated files in the source directory that are not checked into CVS, but should not delete anything checked into CVS@. @end table +@file{Make-lang.in} must also define a variable @code{@var{lang}_OBJS} +to a list of host object files that are used by that language. This +variable is used to handle automatic dependency tracking in the master +@file{Makefile}. + @item lang.opt This file registers the set of switches that the front end accepts on the command line, and their @option{--help} text. @xref{Options}. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 02680a9c06b..77889cf9d54 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -100,14 +100,8 @@ rtx const_true_rtx; REAL_VALUE_TYPE dconst0; REAL_VALUE_TYPE dconst1; REAL_VALUE_TYPE dconst2; -REAL_VALUE_TYPE dconst3; -REAL_VALUE_TYPE dconst10; REAL_VALUE_TYPE dconstm1; -REAL_VALUE_TYPE dconstm2; REAL_VALUE_TYPE dconsthalf; -REAL_VALUE_TYPE dconstthird; -REAL_VALUE_TYPE dconstsqrt2; -REAL_VALUE_TYPE dconste; /* Record fixed-point constant 0 and 1. */ FIXED_VALUE_TYPE fconst0[MAX_FCONST0]; @@ -5245,26 +5239,16 @@ init_emit_once (int line_numbers) REAL_VALUE_FROM_INT (dconst0, 0, 0, double_mode); REAL_VALUE_FROM_INT (dconst1, 1, 0, double_mode); REAL_VALUE_FROM_INT (dconst2, 2, 0, double_mode); - REAL_VALUE_FROM_INT (dconst3, 3, 0, double_mode); - REAL_VALUE_FROM_INT (dconst10, 10, 0, double_mode); - REAL_VALUE_FROM_INT (dconstm1, -1, -1, double_mode); - REAL_VALUE_FROM_INT (dconstm2, -2, -1, double_mode); + + dconstm1 = dconst1; + dconstm1.sign = 1; dconsthalf = dconst1; SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1); - real_arithmetic (&dconstthird, RDIV_EXPR, &dconst1, &dconst3); - - /* Initialize mathematical constants for constant folding builtins. - These constants need to be given to at least 160 bits precision. */ - real_from_string (&dconstsqrt2, - "1.4142135623730950488016887242096980785696718753769480731766797379907"); - real_from_string (&dconste, - "2.7182818284590452353602874713526624977572470936999595749669676277241"); - for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++) { - REAL_VALUE_TYPE *r = + const REAL_VALUE_TYPE *const r = (i == 0 ? &dconst0 : i == 1 ? &dconst1 : &dconst2); for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 54a8fcbadb7..b0d293924c0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in: Remove .o targets. + (fortran_OBJS): New variable. + (fortran/gfortranspec.o): Move to fortran/. Reduce to variable + setting. + (GFORTRAN_D_OBJS): Update. + (GFORTRAN_TRANS_DEPS): Remove. + 2008-03-24 Paul Thomas <pault@gcc.gnu.org> PR fortran/34813 diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 1702b9f124f..6e3d2ce96d7 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -67,6 +67,8 @@ F95_OBJS = $(F95_PARSER_OBJS) \ fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o \ fortran/trans-stmt.o fortran/trans-types.o +fortran_OBJS = $(F95_OBJS) fortran/gfortranspec.o + # # Define the names for selecting gfortran in LANGUAGES. fortran: f951$(exeext) @@ -74,13 +76,11 @@ fortran: f951$(exeext) # Tell GNU make to ignore files by these names if they exist. .PHONY: fortran -gfortranspec.o: $(srcdir)/fortran/gfortranspec.c $(SYSTEM_H) $(TM_H) $(GCC_H) $(CONFIG_H) - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \ - $(INCLUDES) $(srcdir)/fortran/gfortranspec.c) +fortran/gfortranspec.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) # Create the compiler driver gfortran. -GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o version.o prefix.o intl.o +GFORTRAN_D_OBJS = $(GCC_OBJS) fortran/gfortranspec.o version.o prefix.o intl.o gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -279,51 +279,3 @@ fortran.stageprofile: stageprofile-start -mv fortran/*$(objext) stageprofile/fortran fortran.stagefeedback: stageprofile-start -mv fortran/*$(objext) stagefeedback/fortran - -# -# .o: .h dependencies. - -# Everything depends on gfortran.h, but only a few files depend on -# the other headers. So at some point we'll have to split out -# which objects depend on what. FIXME -# TODO: Add dependencies on the backend/tree header files - -$(F95_PARSER_OBJS): fortran/gfortran.h fortran/libgfortran.h \ - fortran/intrinsic.h fortran/match.h \ - fortran/parse.h fortran/arith.h fortran/target-memory.h \ - $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TM_P_H) coretypes.h \ - $(RTL_H) $(TREE_H) $(TREE_DUMP_H) $(GGC_H) $(EXPR_H) \ - $(FLAGS_H) output.h $(DIAGNOSTIC_H) errors.h $(FUNCTION_H) -fortran/openmp.o: pointer-set.h $(TARGET_H) toplev.h - -GFORTRAN_TRANS_DEPS = fortran/gfortran.h fortran/libgfortran.h \ - fortran/intrinsic.h fortran/trans-array.h \ - fortran/trans-const.h fortran/trans-const.h fortran/trans.h \ - fortran/trans-stmt.h fortran/trans-types.h \ - $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) coretypes.h $(GGC_H) - -fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \ - gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) \ - $(BUILTINS_DEF) fortran/types.def -fortran/scanner.o: toplev.h -fortran/convert.o: $(GFORTRAN_TRANS_DEPS) -fortran/trans.o: $(GFORTRAN_TRANS_DEPS) -fortran/trans-decl.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-decl.h \ - $(CGRAPH_H) $(TARGET_H) $(FUNCTION_H) $(FLAGS_H) $(RTL_H) $(TREE_GIMPLE_H) \ - $(TREE_DUMP_H) -fortran/trans-types.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-types.h \ - $(REAL_H) toplev.h $(TARGET_H) $(FLAGS_H) dwarf2out.h -fortran/trans-const.o: $(GFORTRAN_TRANS_DEPS) -fortran/trans-expr.o: $(GFORTRAN_TRANS_DEPS) fortran/dependency.h -fortran/trans-stmt.o: $(GFORTRAN_TRANS_DEPS) fortran/dependency.h -fortran/trans-openmp.o: $(GFORTRAN_TRANS_DEPS) -fortran/trans-io.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-io.h \ - fortran/ioparm.def -fortran/trans-array.o: $(GFORTRAN_TRANS_DEPS) -fortran/trans-intrinsic.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \ - gt-fortran-trans-intrinsic.h -fortran/dependency.o: $(GFORTRAN_TRANS_DEPS) fortran/dependency.h -fortran/trans-common.o: $(GFORTRAN_TRANS_DEPS) $(TARGET_H) $(RTL_H) -fortran/resolve.o: fortran/dependency.h fortran/data.h fortran/target-memory.h -fortran/data.o: fortran/data.h -fortran/options.o: $(PARAMS_H) $(TARGET_H) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 7a35a1e73bd..b96dad55d85 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,17 @@ +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in: Removed most explicit .o targets. + (java/jvspec.o): Reduce to variable setting. Moved to java/. + ($(GCJ)$(exeext)): Update. + (JAVA_OBJS): New variable. + (JCFDUMP_OBJS): Reformat. + (java_OBJS): New variable. + (java/jvspec.o-warn): Update. + (java/parse.o-warn): Remove. + (JAVA_TREE_H): Remove. + (java/jcf-io.o): Reduce to variable setting. + (ALL_CPPFLAGS): Likewise. + 2008-03-12 Paolo Bonzini <bonzini@gnu.org> * mangle.c (java_mangle_decl): Remove dead check. diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index bfb57a3b59b..d114d87ffe0 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -56,16 +56,13 @@ JAVA_TARGET_INDEPENDENT_BIN_TOOLS = jcf-dump # Tell GNU make to ignore these if they exist. .PHONY: java -jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) coretypes.h $(TM_H) \ - $(GCC_H) $(CONFIG_H) - (SHLIB_LINK='$(SHLIB_LINK)'; \ - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \ - $(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION)) +java/jvspec.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) # Create the compiler driver for $(GCJ). -$(GCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o version.o \ +$(GCJ)$(exeext): $(GCC_OBJS) java/jvspec.o java/jcf-path.o version.o \ prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) jvspec.o \ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) java/jvspec.o \ java/jcf-path.o prefix.o intl.o \ version.o $(EXTRA_GCC_OBJS) $(LIBS) @@ -77,27 +74,27 @@ $(GCJ)-cross$(exeext): $(GCJ)$(exeext) java.srcextra: # Executables built by this Makefile: -JAVA_OBJS = java/class.o java/decl.o java/expr.o \ - java/constants.o java/lang.o java/typeck.o java/except.o \ - java/verify-glue.o java/verify-impl.o \ - java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o java/mangle.o \ - java/mangle_name.o java/builtins.o java/resource.o \ - java/jcf-depend.o \ - java/jcf-path.o java/boehm.o java/java-gimplify.o +JAVA_OBJS = java/class.o java/decl.o java/expr.o java/constants.o \ + java/lang.o java/typeck.o java/except.o java/verify-glue.o \ + java/verify-impl.o java/zextract.o java/jcf-io.o java/win32-host.o \ + java/jcf-parse.o java/mangle.o java/mangle_name.o java/builtins.o \ + java/resource.o java/jcf-depend.o java/jcf-path.o java/boehm.o \ + java/java-gimplify.o -JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ - java/win32-host.o java/zextract.o errors.o version.o ggc-none.o intl.o +JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o \ + java/jcf-path.o java/win32-host.o java/zextract.o errors.o version.o \ + ggc-none.o intl.o JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o +# Used by dependency tracking. Sort makes the list unique. +java_OBJS = $(sort $(JAVA_OBJS) $(JCFDUMP_OBJS) $(JVGENMAIN_OBJS)) java/jvspec.o + # Use strict warnings for this front end. java-warn = $(STRICT_WARN) # String length warnings -jvspec.o-warn = -Wno-error - -# Bison-1.75 output often yields (harmless) -Wtraditional warnings -java/parse.o-warn = -Wno-error +java/jvspec.o-warn = -Wno-error jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS) attribs.o rm -f $@ @@ -239,76 +236,16 @@ java.stagefeedback: stageprofile-start -mv java/*$(objext) stagefeedback/java # -# .o:.h dependencies. -JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) java/java-tree.h java/java-tree.def - -java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \ - java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \ - version.h $(GGC_H) intl.h java/zipfile.h -java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(JAVA_TREE_H) java/parse.h toplev.h -java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(JAVA_TREE_H) $(GGC_H) $(FLAGS_H) $(OPTABS_H) $(EXPR_H) langhooks.h \ - gt-java-builtins.h -java/class.o: java/class.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(JAVA_TREE_H) $(RTL_H) java/jcf.h java/parse.h toplev.h output.h $(GGC_H) \ - $(TARGET_H) $(FUNCTION_H) gt-java-class.h $(CGRAPH_H) -java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ - toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-constants.h -java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ - toplev.h $(FLAGS_H) $(SYSTEM_H) coretypes.h $(TM_H) $(FUNCTION_H) $(EXPR_H) \ - libfuncs.h except.h java/java-except.h $(GGC_H) $(REAL_H) gt-java-decl.h \ - $(TARGET_H) $(CGRAPH_H) langhooks.h -java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \ - $(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \ - toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(FUNCTION_H) -java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \ - $(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \ - java/java-except.h java/java-except.h java/parse.h toplev.h \ - $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h $(TARGET_H) -java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) java/jcf.h -java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(FLAGS_H) \ - input.h java/java-except.h $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ - java/parse.h $(GGC_H) debug.h $(REAL_H) gt-java-jcf-parse.h $(TM_P_H) \ - java/jcf-reader.c java/zipfile.h java/jcf.h -java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) intl.h -java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \ - toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(EXPR_H) $(DIAGNOSTIC_H) \ - langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.h -java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) toplev.h $(GGC_H) gt-java-mangle.h $(LANGHOOKS_DEF_H) -java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \ - $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(GGC_H) -java/resource.o: java/resource.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(JAVA_TREE_H) $(RTL_H) java/jcf.h java/parse.h toplev.h output.h $(GGC_H) \ - $(TARGET_H) $(FUNCTION_H) gt-java-resource.h $(EXPR_H) -java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ - toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) $(REAL_H) -java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) coretypes.h java/jcf.h -java/verify-glue.o: java/verify-glue.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \ - coretypes.h $(TM_H) java/verify.h toplev.h -java/verify-impl.o: java/verify-impl.c $(CONFIG_H) java/verify.h $(SYSTEM_H) \ - coretypes.h java/jcf.h $(JAVA_TREE_H) -java/zextract.o: java/zextract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - java/zipfile.h -java/java-gimplify.o: java/java-gimplify.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) $(JAVA_TREE_H) $(TREE_GIMPLE_H) toplev.h # jcf-io.o needs $(ZLIBINC) added to cflags. -java/jcf-io.o: java/jcf-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(JAVA_TREE_H) java/zipfile.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \ - $(srcdir)/java/jcf-io.c $(OUTPUT_OPTION) +java/jcf-io.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(ZLIBINC) # jcf-path.o needs a -D. -java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - java/jcf.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ +java/jcf-path.o: \ + ALL_CPPFLAGS := $(ALL_CPPFLAGS) \ -DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(version).jar"' \ - -DDEFAULT_TARGET_VERSION=\"$(version)\" \ - $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION) + -DDEFAULT_TARGET_VERSION=\"$(version)\" TEXI_JAVA_FILES = java/gcj.texi $(gcc_docdir)/include/fdl.texi \ $(gcc_docdir)/include/gpl.texi $(gcc_docdir)/include/gcc-common.texi \ diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index b71a4d1a85f..7584ed19d96 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,14 @@ +2008-03-25 Andrew Pinski <pinskia@gmail.com> + + PR objc/29197 + * objc-act.c (encode_type): Handle when type is error_mark_node. + (objc_push_parm): Handle when the type of parm is error_mark_node. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in (objc_OBJS): New variable. + (cc1obj-checksum.o, objc/objc-lang.o, objc/objc-act.o): Remove. + 2008-03-21 Andreas Tobler <a.tobler@schweiz.org> PR bootstrap/35660 diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in index af68816c58e..91c4fcefffc 100644 --- a/gcc/objc/Make-lang.in +++ b/gcc/objc/Make-lang.in @@ -1,5 +1,5 @@ # Top level -*- makefile -*- fragment for GNU Objective-C -# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007 +# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 # Free Software Foundation, Inc. #This file is part of GCC. @@ -49,6 +49,8 @@ objc-warn = $(STRICT_WARN) # Language-specific object files for Objective C. OBJC_OBJS = objc/objc-lang.o objc/objc-act.o +objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o + cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o \ @@ -57,28 +59,11 @@ cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEN cc1obj-checksum.c : cc1obj-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1obj-dummy$(exeext) > $@ -cc1obj-checksum.o : cc1obj-checksum.c - cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \ $(BACKEND) $(LIBS) $(GMPLIBS) -# Objective C language specific files. - -objc/objc-lang.o : objc/objc-lang.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(DIAGNOSTIC_H) \ - $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \ - c-objc-common.h objc/objc-act.h $(TREE_GIMPLE_H) - -objc/objc-act.o : objc/objc-act.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \ - $(EXPR_H) $(TARGET_H) $(C_TREE_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \ - objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \ - $(LANGHOOKS_DEF_H) $(HASHTAB_H) $(C_PRAGMA_H) gt-objc-objc-act.h \ - $(TREE_GIMPLE_H) - objc.srcextra: # diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 576e5695b99..48bf974fb36 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -8075,6 +8075,9 @@ encode_type (tree type, int curtype, int format) enum tree_code code = TREE_CODE (type); char c; + if (type == error_mark_node) + return; + if (TYPE_READONLY (type)) obstack_1grow (&util_obstack, 'r'); @@ -8231,6 +8234,13 @@ static void objc_push_parm (tree parm) { bool relayout_needed = false; + + if (TREE_TYPE (parm) == error_mark_node) + { + objc_parmlist = chainon (objc_parmlist, parm); + return; + } + /* Decay arrays and functions into pointers. */ if (TREE_CODE (TREE_TYPE (parm)) == ARRAY_TYPE) { diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index 227f52ebae2..cdc6144d616 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,14 @@ +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in (obj-c++_OBJS): Rename from objcp_OBJS. + (objcp/objcp-act.o): Restore target. + +2008-03-25 Tom Tromey <tromey@redhat.com> + + * Make-lang.in (objcp_OBJS): New variable. + (cc1objplus-checksum.o, objcp/objcp-lang.o, objcp/objcp-decl.o, + objcp/objcp-act.o): Remove. + 2008-03-07 Paolo Bonzini <bonzini@gnu.org> Revert: diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in index 97b79c2732c..77e14516298 100644 --- a/gcc/objcp/Make-lang.in +++ b/gcc/objcp/Make-lang.in @@ -1,5 +1,5 @@ # Top level -*- makefile -*- fragment for GNU Objective-C++ -# Copyright (C) 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. # Contributed by Ziemowit Laski <zlaski@apple.com> #This file is part of GCC. @@ -51,6 +51,8 @@ objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \ $(CXX_AND_OBJCXX_OBJS) +obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o + cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \ $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ @@ -59,33 +61,13 @@ cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \ cc1objplus-checksum.c : cc1objplus-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1objplus-dummy$(exeext) > $@ -cc1objplus-checksum.o : cc1objplus-checksum.c - cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) $(GMPLIBS) -# Objective C++ language specific files. - -objcp/objcp-lang.o : objcp/objcp-lang.c \ - $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \ - $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objcp.h \ - $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(TREE_GIMPLE_H) - -objcp/objcp-decl.o : objcp/objcp-decl.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \ - toplev.h $(GGC_H) $(C_PRAGMA_H) input.h $(FLAGS_H) output.h \ - objc/objc-act.h objcp/objcp-decl.h $(TREE_GIMPLE_H) $(EXPR_H) $(TARGET_H) - -# The following must be an explicit rule; please keep in sync with the implicit -# one in Makefile.in. -objcp/objcp-act.o : objc/objc-act.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \ - $(EXPR_H) $(TARGET_H) $(CXX_TREE_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \ - objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \ - objcp/objcp-decl.h $(LANGHOOKS_DEF_H) $(HASHTAB_H) gt-objc-objc-act.h \ - $(TREE_GIMPLE_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) +# Note that the source file is in a different directory. +objcp/objcp-act.o: objc/objc-act.c + $(COMPILE) $< po-generated: diff --git a/gcc/real.c b/gcc/real.c index 38f18a8462a..ac3b7dc02ec 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -2163,6 +2163,49 @@ times_pten (REAL_VALUE_TYPE *r, int exp) do_divide (r, r, &pten); } +/* Returns the special REAL_VALUE_TYPE enumerated by E. */ + +const REAL_VALUE_TYPE * +get_real_const (enum real_value_const e) +{ + static REAL_VALUE_TYPE value[rv_max]; + + gcc_assert (e < rv_max); + + /* Initialize mathematical constants for constant folding builtins. + These constants need to be given to at least 160 bits precision. */ + if (value[e].cl == rvc_zero) + switch (e) + { + case rv_e: + { + mpfr_t m; + mpfr_init2 (m, SIGNIFICAND_BITS); + mpfr_set_ui (m, 1, GMP_RNDN); + mpfr_exp (m, m, GMP_RNDN); + real_from_mpfr (&value[e], m, NULL_TREE, GMP_RNDN); + mpfr_clear (m); + } + break; + case rv_third: + real_arithmetic (&value[e], RDIV_EXPR, &dconst1, real_digit (3)); + break; + case rv_sqrt2: + { + mpfr_t m; + mpfr_init2 (m, SIGNIFICAND_BITS); + mpfr_sqrt_ui (m, 2, GMP_RNDN); + real_from_mpfr (&value[e], m, NULL_TREE, GMP_RNDN); + mpfr_clear (m); + } + break; + default: + gcc_unreachable(); + } + + return &value[e]; +} + /* Fills R with +Inf. */ void diff --git a/gcc/real.h b/gcc/real.h index 6cf0d1f511b..9809004ab16 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -374,19 +374,24 @@ extern void real_ldexp (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int); /* **** End of software floating point emulator interface macros **** */ -/* Constant real values 0, 1, 2, 3, 10, -1, -2, 0.5 and 1/3. */ +/* Constant real values 0, 1, 2, -1 and 0.5. */ extern REAL_VALUE_TYPE dconst0; extern REAL_VALUE_TYPE dconst1; extern REAL_VALUE_TYPE dconst2; -extern REAL_VALUE_TYPE dconst3; -extern REAL_VALUE_TYPE dconst10; extern REAL_VALUE_TYPE dconstm1; -extern REAL_VALUE_TYPE dconstm2; extern REAL_VALUE_TYPE dconsthalf; -extern REAL_VALUE_TYPE dconstthird; -extern REAL_VALUE_TYPE dconstsqrt2; -extern REAL_VALUE_TYPE dconste; + +/* Enumerate the special constant values we need. */ +enum real_value_const { + rv_e, + rv_third, + rv_sqrt2, + rv_max +}; + +/* Function to return a real value special constant. */ +extern const REAL_VALUE_TYPE * get_real_const (enum real_value_const); /* Function to return a real value (not a tree node) from a given integer constant. */ diff --git a/gcc/reload1.c b/gcc/reload1.c index d0fec9b29af..47d97fba477 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -158,7 +158,7 @@ static HARD_REG_SET reg_reloaded_dead; /* Indicate whether the register's current value is one that is not safe to retain across a call, even for registers that are normally - call-saved. */ + call-saved. This is only meaningful for members of reg_reloaded_valid. */ static HARD_REG_SET reg_reloaded_call_part_clobbered; /* Number of spill-regs so far; number of valid elements of spill_regs. */ @@ -434,9 +434,8 @@ static void emit_output_reload_insns (struct insn_chain *, struct reload *, int); static void do_input_reload (struct insn_chain *, struct reload *, int); static void do_output_reload (struct insn_chain *, struct reload *, int); -static bool inherit_piecemeal_p (int, int); static void emit_reload_insns (struct insn_chain *); -static void delete_output_reload (rtx, int, int); +static void delete_output_reload (rtx, int, int, rtx); static void delete_address_reloads (rtx, rtx); static void delete_address_reloads_1 (rtx, rtx, rtx); static rtx inc_for_reload (rtx, rtx, rtx, int); @@ -4371,7 +4370,6 @@ forget_old_reloads_1 (rtx x, const_rtx ignored ATTRIBUTE_UNUSED, || ! TEST_HARD_REG_BIT (reg_is_output_reload, regno + i)) { CLEAR_HARD_REG_BIT (reg_reloaded_valid, regno + i); - CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, regno + i); spill_reg_store[regno + i] = 0; } } @@ -4408,7 +4406,6 @@ forget_marked_reloads (regset regs) || ! TEST_HARD_REG_BIT (reg_is_output_reload, reg))) { CLEAR_HARD_REG_BIT (reg_reloaded_valid, reg); - CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, reg); spill_reg_store[reg] = 0; } if (n_reloads == 0 @@ -4922,6 +4919,21 @@ reload_reg_reaches_end_p (unsigned int regno, int opnum, enum reload_type type) gcc_unreachable (); } } + +/* Like reload_reg_reaches_end_p, but check that the condition holds for + every register in the range [REGNO, REGNO + NREGS). */ + +static bool +reload_regs_reach_end_p (unsigned int regno, int nregs, + int opnum, enum reload_type type) +{ + int i; + + for (i = 0; i < nregs; i++) + if (!reload_reg_reaches_end_p (regno + i, opnum, type)) + return false; + return true; +} /* Returns whether R1 and R2 are uniquely chained: the value of one @@ -5061,6 +5073,12 @@ static rtx reload_override_in[MAX_RELOADS]; or -1 if we did not need a register for this reload. */ static int reload_spill_index[MAX_RELOADS]; +/* Index X is the value of rld[X].reg_rtx, adjusted for the input mode. */ +static rtx reload_reg_rtx_for_input[MAX_RELOADS]; + +/* Index X is the value of rld[X].reg_rtx, adjusted for the output mode. */ +static rtx reload_reg_rtx_for_output[MAX_RELOADS]; + /* Subroutine of free_for_value_p, used to check a single register. START_REGNO is the starting regno of the full reload register (possibly comprising multiple hard registers) that we are considering. */ @@ -6552,49 +6570,13 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, rtx old, int j) { rtx insn = chain->insn; - rtx reloadreg = rl->reg_rtx; + rtx reloadreg; rtx oldequiv_reg = 0; rtx oldequiv = 0; int special = 0; enum machine_mode mode; rtx *where; - /* Determine the mode to reload in. - This is very tricky because we have three to choose from. - There is the mode the insn operand wants (rl->inmode). - There is the mode of the reload register RELOADREG. - There is the intrinsic mode of the operand, which we could find - by stripping some SUBREGs. - It turns out that RELOADREG's mode is irrelevant: - we can change that arbitrarily. - - Consider (SUBREG:SI foo:QI) as an operand that must be SImode; - then the reload reg may not support QImode moves, so use SImode. - If foo is in memory due to spilling a pseudo reg, this is safe, - because the QImode value is in the least significant part of a - slot big enough for a SImode. If foo is some other sort of - memory reference, then it is impossible to reload this case, - so previous passes had better make sure this never happens. - - Then consider a one-word union which has SImode and one of its - members is a float, being fetched as (SUBREG:SF union:SI). - We must fetch that as SFmode because we could be loading into - a float-only register. In this case OLD's mode is correct. - - Consider an immediate integer: it has VOIDmode. Here we need - to get a mode from something else. - - In some cases, there is a fourth mode, the operand's - containing mode. If the insn specifies a containing mode for - this operand, it overrides all others. - - I am not sure whether the algorithm here is always right, - but it does the right things in those cases. */ - - mode = GET_MODE (old); - if (mode == VOIDmode) - mode = rl->inmode; - /* delete_output_reload is only invoked properly if old contains the original pseudo register. Since this is replaced with a hard reg when RELOAD_OVERRIDE_IN is set, see if we can @@ -6612,6 +6594,9 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, else if (GET_CODE (oldequiv) == SUBREG) oldequiv_reg = SUBREG_REG (oldequiv); + reloadreg = reload_reg_rtx_for_input[j]; + mode = GET_MODE (reloadreg); + /* If we are reloading from a register that was recently stored in with an output-reload, see if we can prove there was actually no need to store the old value in it. */ @@ -6623,16 +6608,11 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, && (dead_or_set_p (insn, spill_reg_stored_to[REGNO (oldequiv)]) || rtx_equal_p (spill_reg_stored_to[REGNO (oldequiv)], rl->out_reg))) - delete_output_reload (insn, j, REGNO (oldequiv)); + delete_output_reload (insn, j, REGNO (oldequiv), reloadreg); - /* Encapsulate both RELOADREG and OLDEQUIV into that mode, - then load RELOADREG from OLDEQUIV. Note that we cannot use - gen_lowpart_common since it can do the wrong thing when - RELOADREG has a multi-word mode. Note that RELOADREG - must always be a REG here. */ + /* Encapsulate OLDEQUIV into the reload mode, then load RELOADREG from + OLDEQUIV. */ - if (GET_MODE (reloadreg) != mode) - reloadreg = reload_adjust_reg_for_mode (reloadreg, mode); while (GET_CODE (oldequiv) == SUBREG && GET_MODE (oldequiv) != mode) oldequiv = SUBREG_REG (oldequiv); if (GET_MODE (oldequiv) != VOIDmode @@ -6696,7 +6676,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, spill_reg_stored_to[REGNO (oldequiv)]) || rtx_equal_p (spill_reg_stored_to[REGNO (oldequiv)], old))) - delete_output_reload (insn, j, REGNO (oldequiv)); + delete_output_reload (insn, j, REGNO (oldequiv), reloadreg); /* Prevent normal processing of this reload. */ special = 1; @@ -6756,7 +6736,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, if (REG_N_DEATHS (REGNO (old)) == 1 && REG_N_SETS (REGNO (old)) == 1) { - reg_renumber[REGNO (old)] = REGNO (rl->reg_rtx); + reg_renumber[REGNO (old)] = REGNO (reloadreg); alter_reg (REGNO (old), -1); } special = 1; @@ -7015,35 +6995,23 @@ static void emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, int j) { - rtx reloadreg = rl->reg_rtx; + rtx reloadreg; rtx insn = chain->insn; int special = 0; rtx old = rl->out; - enum machine_mode mode = GET_MODE (old); + enum machine_mode mode; rtx p; + rtx rl_reg_rtx; if (rl->when_needed == RELOAD_OTHER) start_sequence (); else push_to_sequence (output_reload_insns[rl->opnum]); - /* Determine the mode to reload in. - See comments above (for input reloading). */ - - if (mode == VOIDmode) - { - /* VOIDmode should never happen for an output. */ - if (asm_noperands (PATTERN (insn)) < 0) - /* It's the compiler's fault. */ - fatal_insn ("VOIDmode on an output", insn); - error_for_asm (insn, "output operand is constant in %<asm%>"); - /* Prevent crash--use something we know is valid. */ - mode = word_mode; - old = gen_rtx_REG (mode, REGNO (reloadreg)); - } + rl_reg_rtx = reload_reg_rtx_for_output[j]; + mode = GET_MODE (rl_reg_rtx); - if (GET_MODE (reloadreg) != mode) - reloadreg = reload_adjust_reg_for_mode (reloadreg, mode); + reloadreg = rl_reg_rtx; /* If we need two reload regs, set RELOADREG to the intermediate one, since it will be stored into OLD. We might need a secondary @@ -7167,12 +7135,12 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, reg_has_output_reload will make this do nothing. */ note_stores (pat, forget_old_reloads_1, NULL); - if (reg_mentioned_p (rl->reg_rtx, pat)) + if (reg_mentioned_p (rl_reg_rtx, pat)) { rtx set = single_set (insn); if (reload_spill_index[j] < 0 && set - && SET_SRC (set) == rl->reg_rtx) + && SET_SRC (set) == rl_reg_rtx) { int src = REGNO (SET_SRC (set)); @@ -7181,7 +7149,7 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, if (find_regno_note (insn, REG_DEAD, src)) SET_HARD_REG_BIT (reg_reloaded_died, src); } - if (REGNO (rl->reg_rtx) < FIRST_PSEUDO_REGISTER) + if (HARD_REGISTER_P (rl_reg_rtx)) { int s = rl->secondary_out_reload; set = single_set (p); @@ -7194,7 +7162,7 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, made; leave new_spill_reg_store alone. */ ; else if (s >= 0 - && SET_SRC (set) == rl->reg_rtx + && SET_SRC (set) == rl_reg_rtx && SET_DEST (set) == rld[s].reg_rtx) { /* Usually the next instruction will be the @@ -7215,7 +7183,7 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl, } } else - new_spill_reg_store[REGNO (rl->reg_rtx)] = p; + new_spill_reg_store[REGNO (rl_reg_rtx)] = p; } } } @@ -7242,13 +7210,62 @@ do_input_reload (struct insn_chain *chain, struct reload *rl, int j) rtx insn = chain->insn; rtx old = (rl->in && MEM_P (rl->in) ? rl->in_reg : rl->in); + rtx reg_rtx = rl->reg_rtx; + + if (old && reg_rtx) + { + enum machine_mode mode; + + /* Determine the mode to reload in. + This is very tricky because we have three to choose from. + There is the mode the insn operand wants (rl->inmode). + There is the mode of the reload register RELOADREG. + There is the intrinsic mode of the operand, which we could find + by stripping some SUBREGs. + It turns out that RELOADREG's mode is irrelevant: + we can change that arbitrarily. + + Consider (SUBREG:SI foo:QI) as an operand that must be SImode; + then the reload reg may not support QImode moves, so use SImode. + If foo is in memory due to spilling a pseudo reg, this is safe, + because the QImode value is in the least significant part of a + slot big enough for a SImode. If foo is some other sort of + memory reference, then it is impossible to reload this case, + so previous passes had better make sure this never happens. + + Then consider a one-word union which has SImode and one of its + members is a float, being fetched as (SUBREG:SF union:SI). + We must fetch that as SFmode because we could be loading into + a float-only register. In this case OLD's mode is correct. + + Consider an immediate integer: it has VOIDmode. Here we need + to get a mode from something else. + + In some cases, there is a fourth mode, the operand's + containing mode. If the insn specifies a containing mode for + this operand, it overrides all others. + + I am not sure whether the algorithm here is always right, + but it does the right things in those cases. */ + + mode = GET_MODE (old); + if (mode == VOIDmode) + mode = rl->inmode; + + /* We cannot use gen_lowpart_common since it can do the wrong thing + when REG_RTX has a multi-word mode. Note that REG_RTX must + always be a REG here. */ + if (GET_MODE (reg_rtx) != mode) + reg_rtx = reload_adjust_reg_for_mode (reg_rtx, mode); + } + reload_reg_rtx_for_input[j] = reg_rtx; if (old != 0 /* AUTO_INC reloads need to be handled even if inherited. We got an AUTO_INC reload if reload_out is set but reload_out_reg isn't. */ && (! reload_inherited[j] || (rl->out && ! rl->out_reg)) - && ! rtx_equal_p (rl->reg_rtx, old) - && rl->reg_rtx != 0) + && ! rtx_equal_p (reg_rtx, old) + && reg_rtx != 0) emit_input_reload_insns (chain, rld + j, old, j); /* When inheriting a wider reload, we have a MEM in rl->in, @@ -7267,24 +7284,21 @@ do_input_reload (struct insn_chain *chain, struct reload *rl, int j) if (optimize && (reload_inherited[j] || reload_override_in[j]) - && rl->reg_rtx - && REG_P (rl->reg_rtx) - && spill_reg_store[REGNO (rl->reg_rtx)] != 0 + && reg_rtx + && REG_P (reg_rtx) + && spill_reg_store[REGNO (reg_rtx)] != 0 #if 0 /* There doesn't seem to be any reason to restrict this to pseudos and doing so loses in the case where we are copying from a register of the wrong class. */ - && (REGNO (spill_reg_stored_to[REGNO (rl->reg_rtx)]) - >= FIRST_PSEUDO_REGISTER) + && !HARD_REGISTER_P (spill_reg_stored_to[REGNO (reg_rtx)]) #endif /* The insn might have already some references to stackslots replaced by MEMs, while reload_out_reg still names the original pseudo. */ - && (dead_or_set_p (insn, - spill_reg_stored_to[REGNO (rl->reg_rtx)]) - || rtx_equal_p (spill_reg_stored_to[REGNO (rl->reg_rtx)], - rl->out_reg))) - delete_output_reload (insn, j, REGNO (rl->reg_rtx)); + && (dead_or_set_p (insn, spill_reg_stored_to[REGNO (reg_rtx)]) + || rtx_equal_p (spill_reg_stored_to[REGNO (reg_rtx)], rl->out_reg))) + delete_output_reload (insn, j, REGNO (reg_rtx), reg_rtx); } /* Do output reloading for reload RL, which is for the insn described by @@ -7300,6 +7314,30 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j) not loaded in this same reload, see if we can eliminate a previous store. */ rtx pseudo = rl->out_reg; + rtx reg_rtx = rl->reg_rtx; + + if (rl->out && reg_rtx) + { + enum machine_mode mode; + + /* Determine the mode to reload in. + See comments above (for input reloading). */ + mode = GET_MODE (rl->out); + if (mode == VOIDmode) + { + /* VOIDmode should never happen for an output. */ + if (asm_noperands (PATTERN (insn)) < 0) + /* It's the compiler's fault. */ + fatal_insn ("VOIDmode on an output", insn); + error_for_asm (insn, "output operand is constant in %<asm%>"); + /* Prevent crash--use something we know is valid. */ + mode = word_mode; + rl->out = gen_rtx_REG (mode, REGNO (reg_rtx)); + } + if (GET_MODE (reg_rtx) != mode) + reg_rtx = reload_adjust_reg_for_mode (reg_rtx, mode); + } + reload_reg_rtx_for_output[j] = reg_rtx; if (pseudo && optimize @@ -7318,13 +7356,13 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j) && reg_reloaded_contents[last_regno] == pseudo_no && spill_reg_store[last_regno] && rtx_equal_p (pseudo, spill_reg_stored_to[last_regno])) - delete_output_reload (insn, j, last_regno); + delete_output_reload (insn, j, last_regno, reg_rtx); } old = rl->out_reg; if (old == 0 - || rl->reg_rtx == old - || rl->reg_rtx == 0) + || reg_rtx == 0 + || rtx_equal_p (old, reg_rtx)) return; /* An output operand that dies right away does need a reload, @@ -7333,7 +7371,7 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j) if ((REG_P (old) || GET_CODE (old) == SCRATCH) && (note = find_reg_note (insn, REG_UNUSED, old)) != 0) { - XEXP (note, 0) = rl->reg_rtx; + XEXP (note, 0) = reg_rtx; return; } /* Likewise for a SUBREG of an operand that dies. */ @@ -7342,8 +7380,7 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j) && 0 != (note = find_reg_note (insn, REG_UNUSED, SUBREG_REG (old)))) { - XEXP (note, 0) = gen_lowpart_common (GET_MODE (old), - rl->reg_rtx); + XEXP (note, 0) = gen_lowpart_common (GET_MODE (old), reg_rtx); return; } else if (GET_CODE (old) == SCRATCH) @@ -7357,22 +7394,20 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j) emit_output_reload_insns (chain, rld + j, j); } -/* Reload number R reloads from or to a group of hard registers starting at - register REGNO. Return true if it can be treated for inheritance purposes - like a group of reloads, each one reloading a single hard register. - The caller has already checked that the spill register and REGNO use - the same number of registers to store the reload value. */ +/* A reload copies values of MODE from register SRC to register DEST. + Return true if it can be treated for inheritance purposes like a + group of reloads, each one reloading a single hard register. The + caller has already checked that (reg:MODE SRC) and (reg:MODE DEST) + occupy the same number of hard registers. */ static bool -inherit_piecemeal_p (int r ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED) +inherit_piecemeal_p (int dest ATTRIBUTE_UNUSED, + int src ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED) { #ifdef CANNOT_CHANGE_MODE_CLASS - return (!REG_CANNOT_CHANGE_MODE_P (reload_spill_index[r], - GET_MODE (rld[r].reg_rtx), - reg_raw_mode[reload_spill_index[r]]) - && !REG_CANNOT_CHANGE_MODE_P (regno, - GET_MODE (rld[r].reg_rtx), - reg_raw_mode[regno])); + return (!REG_CANNOT_CHANGE_MODE_P (dest, mode, reg_raw_mode[dest]) + && !REG_CANNOT_CHANGE_MODE_P (src, mode, reg_raw_mode[src])); #else return true; #endif @@ -7414,9 +7449,13 @@ emit_reload_insns (struct insn_chain *chain) for (j = 0; j < n_reloads; j++) { - if (rld[j].reg_rtx - && REGNO (rld[j].reg_rtx) < FIRST_PSEUDO_REGISTER) - new_spill_reg_store[REGNO (rld[j].reg_rtx)] = 0; + if (rld[j].reg_rtx && HARD_REGISTER_P (rld[j].reg_rtx)) + { + unsigned int i; + + for (i = REGNO (rld[j].reg_rtx); i < END_REGNO (rld[j].reg_rtx); i++) + new_spill_reg_store[i] = 0; + } do_input_reload (chain, rld + j, j); do_output_reload (chain, rld + j, j); @@ -7515,104 +7554,108 @@ emit_reload_insns (struct insn_chain *chain) { int nr = hard_regno_nregs[i][GET_MODE (rld[r].reg_rtx)]; int k; - int part_reaches_end = 0; - int all_reaches_end = 1; /* For a multi register reload, we need to check if all or part of the value lives to the end. */ for (k = 0; k < nr; k++) - { - if (reload_reg_reaches_end_p (i + k, rld[r].opnum, - rld[r].when_needed)) - part_reaches_end = 1; - else - all_reaches_end = 0; - } + if (reload_reg_reaches_end_p (i + k, rld[r].opnum, + rld[r].when_needed)) + CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); - /* Ignore reloads that don't reach the end of the insn in - entirety. */ - if (all_reaches_end) - { - /* First, clear out memory of what used to be in this spill reg. - If consecutive registers are used, clear them all. */ - - for (k = 0; k < nr; k++) - { - CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); - CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); - } - - /* Maybe the spill reg contains a copy of reload_out. */ - if (rld[r].out != 0 - && (REG_P (rld[r].out) + /* Maybe the spill reg contains a copy of reload_out. */ + if (rld[r].out != 0 + && (REG_P (rld[r].out) #ifdef AUTO_INC_DEC - || ! rld[r].out_reg + || ! rld[r].out_reg #endif - || REG_P (rld[r].out_reg))) + || REG_P (rld[r].out_reg))) + { + rtx reg; + enum machine_mode mode; + int regno, nregs; + + reg = reload_reg_rtx_for_output[r]; + mode = GET_MODE (reg); + regno = REGNO (reg); + nregs = hard_regno_nregs[regno][mode]; + if (reload_regs_reach_end_p (regno, nregs, rld[r].opnum, + rld[r].when_needed)) { rtx out = (REG_P (rld[r].out) ? rld[r].out : rld[r].out_reg ? rld[r].out_reg /* AUTO_INC */ : XEXP (rld[r].in_reg, 0)); - int nregno = REGNO (out); - int nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 - : hard_regno_nregs[nregno] - [GET_MODE (rld[r].reg_rtx)]); + int out_regno = REGNO (out); + int out_nregs = (!HARD_REGISTER_NUM_P (out_regno) ? 1 + : hard_regno_nregs[out_regno][mode]); bool piecemeal; - spill_reg_store[i] = new_spill_reg_store[i]; - spill_reg_stored_to[i] = out; - reg_last_reload_reg[nregno] = rld[r].reg_rtx; + spill_reg_store[regno] = new_spill_reg_store[regno]; + spill_reg_stored_to[regno] = out; + reg_last_reload_reg[out_regno] = reg; - piecemeal = (nregno < FIRST_PSEUDO_REGISTER - && nr == nnr - && inherit_piecemeal_p (r, nregno)); + piecemeal = (HARD_REGISTER_NUM_P (out_regno) + && nregs == out_nregs + && inherit_piecemeal_p (out_regno, regno, mode)); - /* If NREGNO is a hard register, it may occupy more than + /* If OUT_REGNO is a hard register, it may occupy more than one register. If it does, say what is in the rest of the registers assuming that both registers agree on how many words the object takes. If not, invalidate the subsequent registers. */ - if (nregno < FIRST_PSEUDO_REGISTER) - for (k = 1; k < nnr; k++) - reg_last_reload_reg[nregno + k] - = (piecemeal - ? regno_reg_rtx[REGNO (rld[r].reg_rtx) + k] - : 0); + if (HARD_REGISTER_NUM_P (out_regno)) + for (k = 1; k < out_nregs; k++) + reg_last_reload_reg[out_regno + k] + = (piecemeal ? regno_reg_rtx[regno + k] : 0); /* Now do the inverse operation. */ - for (k = 0; k < nr; k++) + for (k = 0; k < nregs; k++) { - CLEAR_HARD_REG_BIT (reg_reloaded_dead, i + k); - reg_reloaded_contents[i + k] - = (nregno >= FIRST_PSEUDO_REGISTER || !piecemeal - ? nregno - : nregno + k); - reg_reloaded_insn[i + k] = insn; - SET_HARD_REG_BIT (reg_reloaded_valid, i + k); - if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (out))) - SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); + CLEAR_HARD_REG_BIT (reg_reloaded_dead, regno + k); + reg_reloaded_contents[regno + k] + = (!HARD_REGISTER_NUM_P (out_regno) || !piecemeal + ? out_regno + : out_regno + k); + reg_reloaded_insn[regno + k] = insn; + SET_HARD_REG_BIT (reg_reloaded_valid, regno + k); + if (HARD_REGNO_CALL_PART_CLOBBERED (regno + k, mode)) + SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + regno + k); + else + CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + regno + k); } } - - /* Maybe the spill reg contains a copy of reload_in. Only do - something if there will not be an output reload for - the register being reloaded. */ - else if (rld[r].out_reg == 0 - && rld[r].in != 0 - && ((REG_P (rld[r].in) - && REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER - && !REGNO_REG_SET_P (®_has_output_reload, - REGNO (rld[r].in))) - || (REG_P (rld[r].in_reg) - && !REGNO_REG_SET_P (®_has_output_reload, - REGNO (rld[r].in_reg)))) - && ! reg_set_p (rld[r].reg_rtx, PATTERN (insn))) + } + /* Maybe the spill reg contains a copy of reload_in. Only do + something if there will not be an output reload for + the register being reloaded. */ + else if (rld[r].out_reg == 0 + && rld[r].in != 0 + && ((REG_P (rld[r].in) + && !HARD_REGISTER_P (rld[r].in) + && !REGNO_REG_SET_P (®_has_output_reload, + REGNO (rld[r].in))) + || (REG_P (rld[r].in_reg) + && !REGNO_REG_SET_P (®_has_output_reload, + REGNO (rld[r].in_reg)))) + && !reg_set_p (reload_reg_rtx_for_input[r], PATTERN (insn))) + { + rtx reg; + enum machine_mode mode; + int regno, nregs; + + reg = reload_reg_rtx_for_input[r]; + mode = GET_MODE (reg); + regno = REGNO (reg); + nregs = hard_regno_nregs[regno][mode]; + if (reload_regs_reach_end_p (regno, nregs, rld[r].opnum, + rld[r].when_needed)) { - int nregno; - int nnr; + int in_regno; + int in_nregs; rtx in; bool piecemeal; @@ -7623,24 +7666,21 @@ emit_reload_insns (struct insn_chain *chain) in = rld[r].in_reg; else in = XEXP (rld[r].in_reg, 0); - nregno = REGNO (in); + in_regno = REGNO (in); - nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 - : hard_regno_nregs[nregno] - [GET_MODE (rld[r].reg_rtx)]); + in_nregs = (!HARD_REGISTER_NUM_P (in_regno) ? 1 + : hard_regno_nregs[in_regno][mode]); - reg_last_reload_reg[nregno] = rld[r].reg_rtx; + reg_last_reload_reg[in_regno] = reg; - piecemeal = (nregno < FIRST_PSEUDO_REGISTER - && nr == nnr - && inherit_piecemeal_p (r, nregno)); + piecemeal = (HARD_REGISTER_NUM_P (in_regno) + && nregs == in_nregs + && inherit_piecemeal_p (regno, in_regno, mode)); - if (nregno < FIRST_PSEUDO_REGISTER) - for (k = 1; k < nnr; k++) - reg_last_reload_reg[nregno + k] - = (piecemeal - ? regno_reg_rtx[REGNO (rld[r].reg_rtx) + k] - : 0); + if (HARD_REGISTER_NUM_P (in_regno)) + for (k = 1; k < in_nregs; k++) + reg_last_reload_reg[in_regno + k] + = (piecemeal ? regno_reg_rtx[regno + k] : 0); /* Unless we inherited this reload, show we haven't recently done a store. @@ -7648,33 +7688,26 @@ emit_reload_insns (struct insn_chain *chain) also have to be discarded. */ if (! reload_inherited[r] || (rld[r].out && ! rld[r].out_reg)) - spill_reg_store[i] = 0; + spill_reg_store[regno] = 0; - for (k = 0; k < nr; k++) + for (k = 0; k < nregs; k++) { - CLEAR_HARD_REG_BIT (reg_reloaded_dead, i + k); - reg_reloaded_contents[i + k] - = (nregno >= FIRST_PSEUDO_REGISTER || !piecemeal - ? nregno - : nregno + k); - reg_reloaded_insn[i + k] = insn; - SET_HARD_REG_BIT (reg_reloaded_valid, i + k); - if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (in))) - SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k); + CLEAR_HARD_REG_BIT (reg_reloaded_dead, regno + k); + reg_reloaded_contents[regno + k] + = (!HARD_REGISTER_NUM_P (in_regno) || !piecemeal + ? in_regno + : in_regno + k); + reg_reloaded_insn[regno + k] = insn; + SET_HARD_REG_BIT (reg_reloaded_valid, regno + k); + if (HARD_REGNO_CALL_PART_CLOBBERED (regno + k, mode)) + SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + regno + k); + else + CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + regno + k); } } } - - /* However, if part of the reload reaches the end, then we must - invalidate the old info for the part that survives to the end. */ - else if (part_reaches_end) - { - for (k = 0; k < nr; k++) - if (reload_reg_reaches_end_p (i + k, - rld[r].opnum, - rld[r].when_needed)) - CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); - } } /* The following if-statement was #if 0'd in 1.34 (or before...). @@ -7687,7 +7720,7 @@ emit_reload_insns (struct insn_chain *chain) it thinks only about the original insn. So invalidate it here. Also do the same thing for RELOAD_OTHER constraints where the output is discarded. */ - if (i < 0 + if (i < 0 && ((rld[r].out != 0 && (REG_P (rld[r].out) || (MEM_P (rld[r].out) @@ -7697,7 +7730,8 @@ emit_reload_insns (struct insn_chain *chain) { rtx out = ((rld[r].out && REG_P (rld[r].out)) ? rld[r].out : rld[r].out_reg); - int nregno = REGNO (out); + int out_regno = REGNO (out); + enum machine_mode mode = GET_MODE (out); /* REG_RTX is now set or clobbered by the main instruction. As the comment above explains, forget_old_reloads_1 only @@ -7715,16 +7749,16 @@ emit_reload_insns (struct insn_chain *chain) if (rld[r].reg_rtx && rld[r].reg_rtx != out) forget_old_reloads_1 (rld[r].reg_rtx, NULL_RTX, NULL); - if (nregno >= FIRST_PSEUDO_REGISTER) + if (!HARD_REGISTER_NUM_P (out_regno)) { rtx src_reg, store_insn = NULL_RTX; - reg_last_reload_reg[nregno] = 0; + reg_last_reload_reg[out_regno] = 0; /* If we can find a hard register that is stored, record the storing insn so that we may delete this insn with delete_output_reload. */ - src_reg = rld[r].reg_rtx; + src_reg = reload_reg_rtx_for_output[r]; /* If this is an optional reload, try to find the source reg from an input reload. */ @@ -7741,7 +7775,7 @@ emit_reload_insns (struct insn_chain *chain) { if (rld[k].in == src_reg) { - src_reg = rld[k].reg_rtx; + src_reg = reload_reg_rtx_for_input[k]; break; } } @@ -7752,47 +7786,54 @@ emit_reload_insns (struct insn_chain *chain) if (src_reg && REG_P (src_reg) && REGNO (src_reg) < FIRST_PSEUDO_REGISTER) { - int src_regno = REGNO (src_reg); - int nr = hard_regno_nregs[src_regno][rld[r].mode]; + int src_regno, src_nregs, k; + rtx note; + + gcc_assert (GET_MODE (src_reg) == mode); + src_regno = REGNO (src_reg); + src_nregs = hard_regno_nregs[src_regno][mode]; /* The place where to find a death note varies with PRESERVE_DEATH_INFO_REGNO_P . The condition is not necessarily checked exactly in the code that moves notes, so just check both locations. */ - rtx note = find_regno_note (insn, REG_DEAD, src_regno); + note = find_regno_note (insn, REG_DEAD, src_regno); if (! note && store_insn) note = find_regno_note (store_insn, REG_DEAD, src_regno); - while (nr-- > 0) + for (k = 0; k < src_nregs; k++) { - spill_reg_store[src_regno + nr] = store_insn; - spill_reg_stored_to[src_regno + nr] = out; - reg_reloaded_contents[src_regno + nr] = nregno; - reg_reloaded_insn[src_regno + nr] = store_insn; - CLEAR_HARD_REG_BIT (reg_reloaded_dead, src_regno + nr); - SET_HARD_REG_BIT (reg_reloaded_valid, src_regno + nr); - if (HARD_REGNO_CALL_PART_CLOBBERED (src_regno + nr, - GET_MODE (src_reg))) + spill_reg_store[src_regno + k] = store_insn; + spill_reg_stored_to[src_regno + k] = out; + reg_reloaded_contents[src_regno + k] = out_regno; + reg_reloaded_insn[src_regno + k] = store_insn; + CLEAR_HARD_REG_BIT (reg_reloaded_dead, src_regno + k); + SET_HARD_REG_BIT (reg_reloaded_valid, src_regno + k); + if (HARD_REGNO_CALL_PART_CLOBBERED (src_regno + k, + mode)) SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, - src_regno + nr); - SET_HARD_REG_BIT (reg_is_output_reload, src_regno + nr); + src_regno + k); + else + CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, + src_regno + k); + SET_HARD_REG_BIT (reg_is_output_reload, src_regno + k); if (note) SET_HARD_REG_BIT (reg_reloaded_died, src_regno); else CLEAR_HARD_REG_BIT (reg_reloaded_died, src_regno); } - reg_last_reload_reg[nregno] = src_reg; + reg_last_reload_reg[out_regno] = src_reg; /* We have to set reg_has_output_reload here, or else forget_old_reloads_1 will clear reg_last_reload_reg right away. */ SET_REGNO_REG_SET (®_has_output_reload, - nregno); + out_regno); } } else { - int num_regs = hard_regno_nregs[nregno][GET_MODE (out)]; + int k, out_nregs = hard_regno_nregs[out_regno][mode]; - while (num_regs-- > 0) - reg_last_reload_reg[nregno + num_regs] = 0; + for (k = 0; k < out_nregs; k++) + reg_last_reload_reg[out_regno + k] = 0; } } } @@ -8075,10 +8116,11 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type) LAST_RELOAD_REG is the hard register number for which we want to delete the last output reload. J is the reload-number that originally used REG. The caller has made - certain that reload J doesn't use REG any longer for input. */ + certain that reload J doesn't use REG any longer for input. + NEW_RELOAD_REG is reload register that reload J is using for REG. */ static void -delete_output_reload (rtx insn, int j, int last_reload_reg) +delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg) { rtx output_reload_insn = spill_reg_store[last_reload_reg]; rtx reg = spill_reg_stored_to[last_reload_reg]; @@ -8230,7 +8272,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg) } /* For the debugging info, say the pseudo lives in this reload reg. */ - reg_renumber[REGNO (reg)] = REGNO (rld[j].reg_rtx); + reg_renumber[REGNO (reg)] = REGNO (new_reload_reg); alter_reg (REGNO (reg), -1); } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 68ba56bb446..0ad8102a7ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,104 @@ +2008-03-26 Richard Guenther <rguenther@suse.de> + + Revert + 2008-03-26 Richard Guenther <rguenther@suse.de> + + * gcc.dg/fold-addr-1.c: New testcase. + +2008-03-26 Uros Bizjak <ubizjak@gmail.com> + + * gcc.target/i386/sse-13.c: Include <mm_malloc.h> + before redefinitions of extern and __inline. + * gcc.target/i386/sse-13.c: Ditto. + +2008-03-26 Jakub Jelinek <jakub@redhat.com> + + PR c++/35332 + * g++.dg/other/error27.C: New test. + +2008-03-26 Richard Guenther <rguenther@suse.de> + + * gcc.dg/fold-addr-1.c: New testcase. + +2008-03-26 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/20030731-2.c: Scan dce1 dump. + * gcc.dg/tree-ssa/20030917-1.c: Scan optimized dump. + * gcc.dg/tree-ssa/20030917-3.c: Scan ccp1 dump. + * gcc.dg/tree-ssa/20040721-1.c: Test linking, do not disable DOM. + * gcc.dg/tree-ssa/pr21574.c: Scan the fre dump. + * gcc.dg/tree-ssa/ssa-ccp-1.c: Scan ccp1 dump. + * gcc.dg/tree-ssa/ssa-ccp-3.c: Scan ccp2 dump. + +2008-03-26 Douglas Gregor <doug.gregor@gmail.com> + + * g++.dg/cpp0x/variadic84.C: Update to reflect the change in + variadic template template parameter binding semantics. + * g++.dg/cpp0x/variadic85.C: Ditto. + * g++.dg/cpp0x/variadic88.C: New. + * g++.dg/cpp0x/variadic89.C: New. + * g++.dg/cpp0x/variadic90.C: New. + * g++.dg/cpp0x/variadic-ex14.C: Update to reflect the change in + variadic template template parameter binding semantics. + * g++.dg/cpp0x/variadic-lambda.C: New. + +2008-03-25 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR target/31558 + * g++.dg/ext/altivec-15.C: New testcase. + +2008-03-25 Andrew Pinski <pinskia@gmail.com> + + PR objc/29197 + * objc.dg/method-20.m: New testcase. + +2008-03-25 Richard Sandiford <rsandifo@nildram.co.uk> + + PR rtl-optimization/35232 + * gcc.target/mips/pr35232.c: New test. + +2008-03-25 Douglas Gregor <doug.gregor@gmail.com> + + * g++.dg/template/sfinae4.C: New. + * g++.dg/template/sfinae5.C: New. + * g++.dg/template/sfinae6.C: New. + * g++.dg/template/sfinae6_neg.C: New. + * g++.dg/template/sfinae7.C: New. + * g++.dg/template/sfinae8.C: New. + * g++.dg/template/sfinae9.C: New. + * g++.dg/template/sfinae10.C: New. + * g++.dg/template/sfinae11.C: New. + * g++.dg/template/sfinae12.C: New. + * g++.dg/template/sfinae13.C: New. + * g++.dg/template/sfinae14C: New. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * gcc.target/sh/sh2a-bclr.c: New test. + * gcc.target/sh/sh2a-bset.c: New test. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * gcc.target/sh/sh2a-movrt.c: New test. + +2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com> + + * gcc.target/sh/sh2a-prefetch.c: New test. + +2008-03-25 Jayant Sonar <Jayant.sonar@kpitcummins.com> + Naveen.H.S <naveen.hs@kpitcummins.com> + + * gcc.target/sh/sh2a-movi20s.c: New test. + +2008-03-25 Anil Paranjape <anil.paranjape@kpitcummins.com> + Jayant Sonar <Jayant.sonar@kpitcummins.com> + Naveen.H.S <naveen.hs@kpitcummins.com> + + * gcc.target/sh/sh2a-resbank.c: New test. + * gcc.target/sh/sh2a-tbr-jump.c: New test. + * gcc.target/sh/sh2a-jsrn.c: New test. + * gcc.target/sh/sh2a-rtsn.c: New test. + 2008-03-25 Uros Bizjak <ubizjak@gmail.com> * gcc.target/i386/sse-17.c: Include sse2-check.h. @@ -52,8 +153,8 @@ * gcc.dg/tree-ssa/ssa-ccp-17.c: New testcase. -2008-03-20 Victor Kaplansky <victork@gcc.gnu.org> - Uros Bizjak <ubizjak@gmail.com> +2008-03-20 Victor Kaplansky <victork@gcc.gnu.org> + Uros Bizjak <ubizjak@gmail.com> PR testsuite/34168 * lib/target-supports.exp (check_sse2_hw_available): New procedure. diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C index 7050256d437..f33ca0e8618 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C @@ -14,10 +14,6 @@ X<B> xB; // { dg-error "mismatch" } X<C> xC; // { dg-error "mismatch" } // { dg-error "expected a template" "" { target *-*-* } 14 } // { dg-error "invalid type" "" { target *-*-* } 14 } -Y<A> yA; // { dg-error "mismatch" } -// { dg-error "expected a template" "" { target *-*-* } 17 } -// { dg-error "invalid type" "" { target *-*-* } 17 } -Y<B> yB; // { dg-error "mismatch" } -// { dg-error "expected a template" "" { target *-*-* } 20 } -// { dg-error "invalid type" "" { target *-*-* } 20 } +Y<A> yA; +Y<B> yB; Y<C> yC; // okay diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-lambda.C b/gcc/testsuite/g++.dg/cpp0x/variadic-lambda.C new file mode 100644 index 00000000000..705d441493e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-lambda.C @@ -0,0 +1,79 @@ +// { dg-options "-std=c++0x" } + +struct int_placeholder; + +template<typename T> +struct do_replace +{ + typedef T type; +}; + +template<> +struct do_replace<int_placeholder> +{ + typedef int type; +}; + +template<typename T> struct lambdalike +{ + typedef T type; +}; + +template<template<typename...> class TT, typename... Args> +struct lambdalike<TT<Args...> > { + typedef TT<typename do_replace<Args>::type...> type; +}; + + +template<typename T, typename U> +struct is_same +{ + static const bool value = false; +}; + +template<typename T> +struct is_same<T, T> +{ + static const bool value = true; +}; + +template<typename... Elements> struct tuple; +template<typename T1, typename T2> struct pair; + +static_assert(is_same<lambdalike<tuple<float, int_placeholder, double>>::type, + tuple<float, int, double>>::value, + "MPL lambda-like replacement on tuple"); +static_assert(is_same<lambdalike<pair<float, int_placeholder>>::type, + pair<float, int>>::value, + "MPL lambda-like replacement on pair"); + + +struct _1 {}; + +template<typename Arg0, typename Lambda> +struct eval +{ + typedef Lambda type; +}; + +template<typename Arg0> +struct eval<Arg0, _1> +{ + typedef Arg0 type; +}; + +template<typename Arg0, template<typename...> class T, typename... Pack> +struct eval<Arg0, T<Pack...> > +{ + typedef T< typename eval<Arg0, Pack>::type... > type; +}; + +static_assert(is_same<eval<int, tuple<float, _1, double>>::type, + tuple<float, int, double>>::value, "eval tuple"); +static_assert(is_same<eval<int, pair<_1, double>>::type, + pair<int, double>>::value, "eval pair"); +static_assert(is_same<eval<int, + tuple<pair<_1, _1>, pair<float, float>, + pair<double, _1>>>::type, + tuple<pair<int, int>, pair<float, float>, pair<double, int>>>::value, + "recursive eval"); diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic84.C b/gcc/testsuite/g++.dg/cpp0x/variadic84.C index d5be7646156..ce31267954f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic84.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic84.C @@ -18,9 +18,9 @@ template<int> struct B1 {}; template<int, int> struct B2 {}; template<typename> struct B3 {}; template<typename, typename> struct B4 {}; -A1<B1<0> > a1; // { dg-error "incomplete type" } -A2<B2<0, 1> > a2; // { dg-error "incomplete type" } -A3<B2<0, 1> > a3; // { dg-error "incomplete type" } -A4<B3<int> > a4; // { dg-error "incomplete type" } -A5<B4<int, long> > a5; // { dg-error "incomplete type" } -A6<B4<int, long> > a6; // { dg-error "incomplete type" } +A1<B1<0> > a1; +A2<B2<0, 1> > a2; +A3<B2<0, 1> > a3; +A4<B3<int> > a4; +A5<B4<int, long> > a5; +A6<B4<int, long> > a6; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic85.C b/gcc/testsuite/g++.dg/cpp0x/variadic85.C index 7004d086a0f..facb263910f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic85.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic85.C @@ -5,6 +5,6 @@ template<typename...> struct A1; template<template<int, int...> class T> struct A1<T<0, 1> > {}; template<int, int, int...> struct B1 {}; -A1<B1<0, 1> > a1; // { dg-error "incomplete type" } +A1<B1<0, 1> > a1; template<int...> struct B2 {}; A1<B2<0, 1> > a2; // { dg-error "incomplete type" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic88.C b/gcc/testsuite/g++.dg/cpp0x/variadic88.C new file mode 100644 index 00000000000..b14cabe3218 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic88.C @@ -0,0 +1,23 @@ +// { dg-options "-std=c++0x" } + +template<template<typename...> class TT> +TT<int, float, double> foo(TT<int, float>) +{ + return TT<int, float, double>(); +} + +template<typename T> +int& foo(T) +{ + static int i = 0; return i; +} + +template<typename T, typename U> +struct pair {}; + +void bar() +{ + pair<int, float> p; + int& i = foo(p); +} + diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic89.C b/gcc/testsuite/g++.dg/cpp0x/variadic89.C new file mode 100644 index 00000000000..b943771a6de --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic89.C @@ -0,0 +1,14 @@ +// { dg-options "-std=c++0x" } +// Contributed by Eric Niebler +template<typename T, typename U> +struct pair +{}; + +template<typename T> +struct test; + +template<template<typename...> class T, typename... Args> +struct test<T<Args...> > +{}; + +test<pair<int, double> > t; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic90.C b/gcc/testsuite/g++.dg/cpp0x/variadic90.C new file mode 100644 index 00000000000..632e166c346 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic90.C @@ -0,0 +1,8 @@ +// { dg-options "-std=c++0x" } + +template<template<typename...> class TT> +struct X { }; + +template<typename T, typename U> struct pair { }; + +X<pair> x; diff --git a/gcc/testsuite/g++.dg/ext/altivec-15.C b/gcc/testsuite/g++.dg/ext/altivec-15.C new file mode 100644 index 00000000000..c3003489a17 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-15.C @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +struct SubData +{ + inline const Float Clamp(Float f, Float f0, Float f1) // { dg-error "" } + } + inline const void SinCos(Float angle, Float& sine, Float& cosine) // { dg-error "" } + { + C0 = __builtin_vec_splat(_simdCosEstCoefficients, 0); // { dg-error "" } + C1 = __builtin_vec_splat(_simdCosEstCoefficients, 1); // { dg-error "" } + diff --git a/gcc/testsuite/g++.dg/other/error27.C b/gcc/testsuite/g++.dg/other/error27.C new file mode 100644 index 00000000000..70ac480ee3e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error27.C @@ -0,0 +1,12 @@ +// PR c++/35332 +// { dg-do compile } + +void foo (double x, double y) +{ + __builtin_isgreater(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } + __builtin_isless(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } + __builtin_isgreaterequal(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } + __builtin_islessequal(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } + __builtin_isunordered(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } + __builtin_islessgreater(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } +} diff --git a/gcc/testsuite/g++.dg/template/sfinae10.C b/gcc/testsuite/g++.dg/template/sfinae10.C new file mode 100644 index 00000000000..e0680db65a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae10.C @@ -0,0 +1,181 @@ +// DR 339 +// +// Test of the use of various unary operators with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#define DEFINE_PREFIX_UNARY_TRAIT(Name,Op) \ +template<typename T> \ + typename enable_if<(sizeof(Op create_a<T>(), 1) > 0), \ + yes_type>::type \ + JOIN(check_,Name)(int); \ + \ +template<typename T> \ + no_type JOIN(check_,Name)(...); \ + \ +template<typename T> \ +struct Name \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,Name)<T&>(0)) == sizeof(yes_type)); \ +} + +#define DEFINE_POSTFIX_UNARY_TRAIT(Name,Op) \ +template<typename T> \ + typename enable_if<(sizeof(create_a<T>() Op, 1) > 0), \ + yes_type>::type \ + JOIN(check_,Name)(int); \ + \ +template<typename T> \ + no_type JOIN(check_,Name)(...); \ + \ +template<typename T> \ +struct Name \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,Name)<T&>(0)) == sizeof(yes_type)); \ +} + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct W { + W operator+(); + W operator-(); + int operator*(); + W operator~(); + bool operator!(); + W& operator++(); + W& operator--(); + W& operator++(int); + W& operator--(int); +}; + +struct X { }; +X operator+(X); +X operator-(X); +int operator*(X); +X operator~(X); +bool operator!(X); +X& operator++(X&); +X& operator--(X&); +X& operator++(X&, int); +X& operator--(X&, int); + +struct Y { }; + +struct Z { +private: + Z operator+(); // { dg-error "is private" } + Z operator-(); // { dg-error "is private" } + int operator*(); // { dg-error "is private" } + Z operator~(); // { dg-error "is private" } + bool operator!(); // { dg-error "is private" } + Z& operator++(); // { dg-error "is private" } + Z& operator--(); // { dg-error "is private" } + Z& operator++(int); // { dg-error "is private" } + Z& operator--(int); // { dg-error "is private" } +}; + +// has_unary_plus +DEFINE_PREFIX_UNARY_TRAIT(has_unary_plus, +); // { dg-error "within this context" } +STATIC_ASSERT((has_unary_plus<int>::value)); +STATIC_ASSERT((!has_unary_plus<int X::*>::value)); +STATIC_ASSERT((has_unary_plus<W>::value)); +STATIC_ASSERT((has_unary_plus<X>::value)); +STATIC_ASSERT((!has_unary_plus<Y>::value)); + +// is_negatable +DEFINE_PREFIX_UNARY_TRAIT(is_negatable, -); // { dg-error "within this context" } +STATIC_ASSERT((is_negatable<int>::value)); +STATIC_ASSERT((!is_negatable<int X::*>::value)); +STATIC_ASSERT((is_negatable<W>::value)); +STATIC_ASSERT((is_negatable<X>::value)); +STATIC_ASSERT((!is_negatable<Y>::value)); + +// is_dereferenceable +DEFINE_PREFIX_UNARY_TRAIT(is_dereferenceable, *); // { dg-error "within this context" } +STATIC_ASSERT((!is_dereferenceable<int>::value)); +STATIC_ASSERT((is_dereferenceable<int*>::value)); +STATIC_ASSERT((is_dereferenceable<W>::value)); +STATIC_ASSERT((is_dereferenceable<X>::value)); +STATIC_ASSERT((!is_dereferenceable<Y>::value)); + +// has_bitwise_not +DEFINE_PREFIX_UNARY_TRAIT(has_bitwise_not, ~); // { dg-error "within this context" } +STATIC_ASSERT((has_bitwise_not<int>::value)); +STATIC_ASSERT((!has_bitwise_not<int*>::value)); +STATIC_ASSERT((has_bitwise_not<W>::value)); +STATIC_ASSERT((has_bitwise_not<X>::value)); +STATIC_ASSERT((!has_bitwise_not<Y>::value)); + +// has_truth_not +DEFINE_PREFIX_UNARY_TRAIT(has_truth_not, !); // { dg-error "within this context" } +STATIC_ASSERT((has_truth_not<int>::value)); +STATIC_ASSERT((has_truth_not<int*>::value)); +STATIC_ASSERT((has_truth_not<W>::value)); +STATIC_ASSERT((has_truth_not<X>::value)); +STATIC_ASSERT((!has_truth_not<Y>::value)); + +// has_preincrement +DEFINE_PREFIX_UNARY_TRAIT(has_preincrement, ++); // { dg-error "within this context" } +STATIC_ASSERT((has_preincrement<int>::value)); +STATIC_ASSERT((has_preincrement<int*>::value)); +STATIC_ASSERT((!has_preincrement<int X::*>::value)); +STATIC_ASSERT((has_preincrement<W>::value)); +STATIC_ASSERT((has_preincrement<X>::value)); +STATIC_ASSERT((!has_preincrement<Y>::value)); + +// has_predecrement +DEFINE_PREFIX_UNARY_TRAIT(has_predecrement, --); // { dg-error "within this context" } +STATIC_ASSERT((has_predecrement<int>::value)); +STATIC_ASSERT((has_predecrement<int*>::value)); +STATIC_ASSERT((!has_predecrement<int X::*>::value)); +STATIC_ASSERT((has_predecrement<W>::value)); +STATIC_ASSERT((has_predecrement<X>::value)); +STATIC_ASSERT((!has_predecrement<Y>::value)); + +// has_postincrement +DEFINE_POSTFIX_UNARY_TRAIT(has_postincrement, ++); // { dg-error "within this context" } +STATIC_ASSERT((has_postincrement<int>::value)); +STATIC_ASSERT((has_postincrement<int*>::value)); +STATIC_ASSERT((!has_postincrement<int X::*>::value)); +STATIC_ASSERT((has_postincrement<W>::value)); +STATIC_ASSERT((has_postincrement<X>::value)); +STATIC_ASSERT((!has_postincrement<Y>::value)); + +// has_postdecrement +DEFINE_POSTFIX_UNARY_TRAIT(has_postdecrement, --); // { dg-error "within this context" } +STATIC_ASSERT((has_postdecrement<int>::value)); +STATIC_ASSERT((has_postdecrement<int*>::value)); +STATIC_ASSERT((!has_postdecrement<int X::*>::value)); +STATIC_ASSERT((has_postdecrement<W>::value)); +STATIC_ASSERT((has_postdecrement<X>::value)); +STATIC_ASSERT((!has_postdecrement<Y>::value)); + +// Check for private members +STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((is_negatable<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-error "instantiated from here" } + diff --git a/gcc/testsuite/g++.dg/template/sfinae11.C b/gcc/testsuite/g++.dg/template/sfinae11.C new file mode 100644 index 00000000000..a813055ead2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae11.C @@ -0,0 +1,53 @@ +// DR 339 +// +// Test of the use of the comma operator with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +template<typename T, typename U> + typename enable_if<(sizeof(create_a<T>(), create_a<U>()) > 0), + yes_type>::type + check_comma(int); + +template<typename T, typename U> no_type check_comma(...); + +template<typename T, typename U> +struct has_comma +{ + static const bool value = + (sizeof(check_comma<T, U>(0)) == sizeof(yes_type)); +}; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct X { }; +struct Y { }; +struct Z { }; + +bool operator,(X&, Y); +bool operator,(X, Z); +void operator,(const Y&, const Z&); + +STATIC_ASSERT((has_comma<int, float>::value)); +STATIC_ASSERT((has_comma<int, X>::value)); +STATIC_ASSERT((has_comma<X, X>::value)); +STATIC_ASSERT((has_comma<X, Y>::value)); +STATIC_ASSERT((has_comma<X&, Y>::value)); +STATIC_ASSERT((has_comma<X, Z>::value)); +STATIC_ASSERT((!has_comma<Y, Z>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae12.C b/gcc/testsuite/g++.dg/template/sfinae12.C new file mode 100644 index 00000000000..c51211be2b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae12.C @@ -0,0 +1,47 @@ +// DR 339 +// +// Test of the use of the ternary operator with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +template<typename T, typename U, typename V> +typename enable_if< + (sizeof((create_a<T>()? create_a<U>() : create_a<V>()), 0) > 0), + yes_type>::type + check_ternary(int); + +template<typename T, typename U, typename V> no_type check_ternary(...); + +template<typename T, typename U, typename V> +struct has_ternary +{ + static const bool value = + (sizeof(check_ternary<T, U, V>(0)) == sizeof(yes_type)); +}; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct X { }; +struct Y { operator bool(); }; + +STATIC_ASSERT((has_ternary<int, float, double>::value)); +STATIC_ASSERT((has_ternary<bool, double, double>::value)); +STATIC_ASSERT((!has_ternary<int, float*, double>::value)); +STATIC_ASSERT((!has_ternary<X, double, double>::value)); +STATIC_ASSERT((has_ternary<Y, double, double>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae13.C b/gcc/testsuite/g++.dg/template/sfinae13.C new file mode 100644 index 00000000000..b659685d88b --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae13.C @@ -0,0 +1,86 @@ +// DR 339 +// +// Test of the use of casts with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#define CHECK_CAST(CastKind) \ +template<typename T, typename U> \ + typename enable_if<(sizeof((JOIN(CastKind,_cast)<U>(create_a<T>())), 0) > 0), \ + yes_type>::type \ + JOIN(check_,JOIN(CastKind,_cast))(int); \ + \ +template<typename T, typename U> \ + no_type JOIN(check_,JOIN(CastKind,_cast))(...); \ + \ +template<typename T, typename U> \ +struct JOIN(has_,JOIN(CastKind,_cast)) \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,JOIN(CastKind,_cast))<T, U>(0)) == sizeof(yes_type)); \ +} + +template<typename T, typename U> +typename enable_if<(sizeof(((U)create_a<T>()), 0) > 0), yes_type>::type + check_c_cast(int); + +template<typename T, typename U> no_type check_c_cast(...); + +template<typename T, typename U> +struct has_c_cast +{ + static const bool value = + (sizeof(check_c_cast<T, U>(0)) == sizeof(yes_type)); +}; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +CHECK_CAST(static); +CHECK_CAST(dynamic); +CHECK_CAST(const); +CHECK_CAST(reinterpret); + +struct X { virtual void f(); }; +struct Y { operator bool(); }; +struct Z : public X { }; + +STATIC_ASSERT((has_static_cast<int, float>::value)); +STATIC_ASSERT((!has_static_cast<X, Y>::value)); +STATIC_ASSERT((has_static_cast<Z, X>::value)); + +STATIC_ASSERT(!(has_dynamic_cast<int, float>::value)); +STATIC_ASSERT(!(has_dynamic_cast<X, Y>::value)); +STATIC_ASSERT(!(has_dynamic_cast<X, Z>::value)); +STATIC_ASSERT(!(has_dynamic_cast<Y, Z>::value)); +STATIC_ASSERT((has_dynamic_cast<X*, Z*>::value)); +STATIC_ASSERT((has_dynamic_cast<X*, Y*>::value)); +STATIC_ASSERT(!(has_dynamic_cast<Y*, Z*>::value)); + +STATIC_ASSERT(!(has_const_cast<int, float>::value)); +STATIC_ASSERT((has_const_cast<const int*, int*>::value)); +STATIC_ASSERT((has_const_cast<int*, const int*>::value)); +STATIC_ASSERT(!(has_const_cast<const int*, float*>::value)); + +STATIC_ASSERT((has_reinterpret_cast<int*, float*>::value)); +STATIC_ASSERT(!(has_reinterpret_cast<void*, char>::value)); +STATIC_ASSERT(!(has_reinterpret_cast<const X, X>::value)); + +STATIC_ASSERT((has_c_cast<int, float>::value)); +STATIC_ASSERT(!(has_c_cast<X, Y>::value)); +STATIC_ASSERT(!(has_c_cast<void*, char>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae14.C b/gcc/testsuite/g++.dg/template/sfinae14.C new file mode 100644 index 00000000000..93eba43a08f --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae14.C @@ -0,0 +1,79 @@ +// DR 339 +// +// Test of the use of the new and new[] operators with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +template<typename T> +typename enable_if<(sizeof(new T, 0) > 0), yes_type>::type + check_new(int); + +template<typename T> no_type check_new(...); + +template<typename T> +struct has_new +{ + static const bool value = + (sizeof(check_new<T>(0)) == sizeof(yes_type)); +}; + +template<typename T, typename U> +typename enable_if<(sizeof((new T(create_a<U>())), 0) > 0), + yes_type>::type + check_new_one_arg(int); + +template<typename T, typename U> no_type check_new_one_arg(...); + +template<typename T, typename U> +struct has_new_one_arg +{ + static const bool value = + (sizeof(check_new_one_arg<T, U>(0)) == sizeof(yes_type)); +}; + +template<typename T, typename U, U N> +typename enable_if<(sizeof(new T[N], 0) > 0), yes_type>::type + check_array_new(int); + +template<typename T, typename U, U N> no_type check_array_new(...); + +template<typename T, typename U, U N> +struct has_array_new +{ + static const bool value = + (sizeof(check_array_new<T, U, N>(0)) == sizeof(yes_type)); +}; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct X { + X(int); +}; + +struct Y { int foo; }; + +STATIC_ASSERT((has_new<Y>::value)); +STATIC_ASSERT(!(has_new<X>::value)); +STATIC_ASSERT((has_new_one_arg<Y, Y>::value)); +STATIC_ASSERT((has_new_one_arg<X, float>::value)); +STATIC_ASSERT(!(has_new_one_arg<X, int X::*>::value)); + +STATIC_ASSERT((has_array_new<Y, int, 5>::value)); +STATIC_ASSERT(!(has_array_new<X, int Y::*, &Y::foo>::value)); +STATIC_ASSERT((has_array_new<X, int, 5>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae4.C b/gcc/testsuite/g++.dg/template/sfinae4.C new file mode 100644 index 00000000000..a9650511e9d --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae4.C @@ -0,0 +1,35 @@ +// DR 339 +// +// Test of the use of free functions with SFINAE +void foo(int) { } +template<typename T> void foo(T*) { } + +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +template<typename T> + typename enable_if<(sizeof(foo(create_a<T const&>()), 1) > 0), + yes_type>::type + check_has_foo(const volatile T&); + +no_type check_has_foo(...); + +template<typename T> +struct has_foo +{ + static const bool value = + (sizeof(check_has_foo(create_a<T const&>())) == sizeof(yes_type)); +}; + +struct X { }; + +int a1[has_foo<int>::value? 1 : -1]; +int a2[has_foo<long>::value? 1 : -1]; +int a3[has_foo<int*>::value? 1 : -1]; +int a4[has_foo<X>::value? -1 : 1]; +int a5[has_foo<int X::*>::value? -1 : 1]; diff --git a/gcc/testsuite/g++.dg/template/sfinae5.C b/gcc/testsuite/g++.dg/template/sfinae5.C new file mode 100644 index 00000000000..516e5cc85fc --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae5.C @@ -0,0 +1,47 @@ +// DR 339 +// +// Test of the use of member functions with SFINAE +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +template<typename T> + typename enable_if<(sizeof(create_a<T>().foo(), 1) > 0), + yes_type>::type + check_has_member_foo(const volatile T&); + +no_type check_has_member_foo(...); + +template<typename T> +struct has_foo +{ + static const bool value = + (sizeof(check_has_member_foo(create_a<T const&>())) == sizeof(yes_type)); +}; + +struct X { }; +struct Y { + void foo(); +}; +struct Z { + void foo(int); +}; + +struct A { + int foo; +}; + +struct B { + static int foo(); +}; + +int a1[has_foo<X>::value? -1 : 1]; +int a2[has_foo<Y>::value? 1 : -1]; +int a3[has_foo<Z>::value? -1 : 1]; +int a4[has_foo<int>::value? -1 : 1]; +int a5[has_foo<A>::value? -1 : 1]; +int a6[has_foo<B>::value? 1 : -1]; diff --git a/gcc/testsuite/g++.dg/template/sfinae6.C b/gcc/testsuite/g++.dg/template/sfinae6.C new file mode 100644 index 00000000000..64567aae28e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae6.C @@ -0,0 +1,83 @@ +// DR 339 +// +// Test of the use of the function call operator with SFINAE +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); + +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +template<typename F, typename T1, typename T2> + typename enable_if<sizeof(create_a<F>()(create_a<T1>(), create_a<T2>()), 1), + yes_type>::type + check_is_callable2(type<F>, type<T1>, type<T2>); + +no_type check_is_callable2(...); + +template<typename F, typename T1, typename T2 = T1> +struct is_callable2 +{ + static const bool value = + (sizeof(check_is_callable2(type<F>(), type<T1>(), type<T2>())) + == sizeof(yes_type)); +}; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + + +struct A; +struct B; + +struct A { + A(B); +}; + +struct B { + B(A); +}; + +struct F1 { }; + +struct F2 { + bool operator()(int, float); +}; + +struct F3 { + bool operator()(int); +}; + +struct F4 { + void operator()(A, A); + void operator()(B, B); +}; + +struct F5 { + void operator()(A, A); + +private: + void operator()(B, B); +}; + +STATIC_ASSERT((is_callable2<int(*)(int, int), long, int>::value)); +STATIC_ASSERT((!is_callable2<int(*)(int, int), int*, int>::value)); +STATIC_ASSERT((!is_callable2<F1, int, int>::value)); +STATIC_ASSERT((is_callable2<F2, int, int>::value)); +STATIC_ASSERT((!is_callable2<F2, int*, int>::value)); +STATIC_ASSERT((!is_callable2<F3, int, int>::value)); +STATIC_ASSERT((is_callable2<F4, A, A>::value)); +STATIC_ASSERT((is_callable2<F4, B, B>::value)); +STATIC_ASSERT((!is_callable2<F4, A, B>::value)); +STATIC_ASSERT((is_callable2<F5, A, A>::value)); +STATIC_ASSERT((!is_callable2<F5, A, B>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae6_neg.C b/gcc/testsuite/g++.dg/template/sfinae6_neg.C new file mode 100644 index 00000000000..2df4ade4720 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae6_neg.C @@ -0,0 +1,58 @@ +// DR 339 +// +// Test of the use of the function call operator with SFINAE +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); + +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +template<typename F, typename T1, typename T2> + typename enable_if<sizeof(create_a<F>()(create_a<T1>(), create_a<T2>()), 1), + yes_type>::type + check_is_callable2(type<F>, type<T1>, type<T2>); + +no_type check_is_callable2(...); + +template<typename F, typename T1, typename T2 = T1> +struct is_callable2 +{ + static const bool value = + (sizeof(check_is_callable2(type<F>(), type<T1>(), type<T2>())) + == sizeof(yes_type)); // { dg-error "within this context" } +}; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + + +struct A; +struct B; + +struct A { + A(B); +}; + +struct B { + B(A); +}; + +struct F { + void operator()(A, A); + +private: + void operator()(B, B); // { dg-error "is private" } +}; + +STATIC_ASSERT((is_callable2<F, B, B>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae7.C b/gcc/testsuite/g++.dg/template/sfinae7.C new file mode 100644 index 00000000000..8551eb279fe --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae7.C @@ -0,0 +1,199 @@ +// DR 339 +// +// Test of the use of various binary operators with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#define DEFINE_INFIX_BINARY_TRAIT(Name,Op) \ +template<typename T, typename U> \ + typename enable_if<(sizeof(create_a<T>() Op create_a<U>(), 1) > 0), \ + yes_type>::type \ + JOIN(check_,Name)(type<T>, type<U>); \ + \ +no_type JOIN(check_,Name)(...); \ + \ +template<typename T, typename U = T> \ +struct Name \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,Name)(type<T>(), type<U>())) == sizeof(yes_type)); \ +} + +template<typename T, typename U> + typename enable_if<(sizeof(create_a<T>()[create_a<U>()], 1) > 0), + yes_type>::type + check_subscript(int); + +template<typename T, typename U> + no_type check_subscript(...); + +template<typename T, typename U> +struct can_subscript +{ + static const bool value = + (sizeof(check_subscript<T, U>(0)) == sizeof(yes_type)); +}; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct X { }; +struct Y { int operator[](X); }; + +// is_addable +DEFINE_INFIX_BINARY_TRAIT(is_addable, +); +X operator+(X, X); +X operator+(X, Y); +STATIC_ASSERT((is_addable<int>::value)); +STATIC_ASSERT((is_addable<int, long>::value)); +STATIC_ASSERT((is_addable<X>::value)); +STATIC_ASSERT((is_addable<int*, int>::value)); +STATIC_ASSERT((!is_addable<int*>::value)); +STATIC_ASSERT((is_addable<X, Y>::value)); +STATIC_ASSERT((!is_addable<Y>::value)); + +// is_subtractable +DEFINE_INFIX_BINARY_TRAIT(is_subtractable, -); +X operator-(X, X); +X operator-(X, Y); +STATIC_ASSERT((is_subtractable<int>::value)); +STATIC_ASSERT((is_subtractable<int, long>::value)); +STATIC_ASSERT((is_subtractable<X>::value)); +STATIC_ASSERT((is_subtractable<int*, int>::value)); +STATIC_ASSERT((is_subtractable<int*>::value)); +STATIC_ASSERT((is_subtractable<X, Y>::value)); +STATIC_ASSERT((!is_subtractable<Y>::value)); +STATIC_ASSERT((!is_subtractable<int X::*>::value)); + +// is_multiplicable +DEFINE_INFIX_BINARY_TRAIT(is_multiplicable, *); +X operator*(X, X); +X operator*(X, Y); +STATIC_ASSERT((is_multiplicable<int>::value)); +STATIC_ASSERT((is_multiplicable<int, long>::value)); +STATIC_ASSERT((is_multiplicable<X>::value)); +STATIC_ASSERT((!is_multiplicable<int*, int>::value)); +STATIC_ASSERT((!is_multiplicable<int*>::value)); +STATIC_ASSERT((is_multiplicable<X, Y>::value)); +STATIC_ASSERT((!is_multiplicable<Y>::value)); +STATIC_ASSERT((!is_multiplicable<int X::*>::value)); + +// is_divisible +DEFINE_INFIX_BINARY_TRAIT(is_divisible, /); +X operator/(X, X); +X operator/(X, Y); +STATIC_ASSERT((is_divisible<int>::value)); +STATIC_ASSERT((is_divisible<int, long>::value)); +STATIC_ASSERT((is_divisible<X>::value)); +STATIC_ASSERT((!is_divisible<int*, int>::value)); +STATIC_ASSERT((!is_divisible<int*>::value)); +STATIC_ASSERT((is_divisible<X, Y>::value)); +STATIC_ASSERT((!is_divisible<Y>::value)); +STATIC_ASSERT((!is_divisible<int X::*>::value)); + +// has_remainder +DEFINE_INFIX_BINARY_TRAIT(has_remainder, %); +X operator%(X, X); +X operator%(X, Y); +STATIC_ASSERT((has_remainder<int>::value)); +STATIC_ASSERT((has_remainder<int, long>::value)); +STATIC_ASSERT((!has_remainder<float>::value)); +STATIC_ASSERT((has_remainder<X>::value)); +STATIC_ASSERT((!has_remainder<int*, int>::value)); +STATIC_ASSERT((!has_remainder<int*>::value)); +STATIC_ASSERT((has_remainder<X, Y>::value)); +STATIC_ASSERT((!has_remainder<Y>::value)); +STATIC_ASSERT((!has_remainder<int X::*>::value)); + +// has_xor +DEFINE_INFIX_BINARY_TRAIT(has_xor, ^); +X operator^(X, X); +X operator^(X, Y); +STATIC_ASSERT((has_xor<int>::value)); +STATIC_ASSERT((has_xor<int, long>::value)); +STATIC_ASSERT((!has_xor<float>::value)); +STATIC_ASSERT((has_xor<X>::value)); +STATIC_ASSERT((!has_xor<int*, int>::value)); +STATIC_ASSERT((!has_xor<int*>::value)); +STATIC_ASSERT((has_xor<X, Y>::value)); +STATIC_ASSERT((!has_xor<Y>::value)); +STATIC_ASSERT((!has_xor<int X::*>::value)); + +// has_bitand +DEFINE_INFIX_BINARY_TRAIT(has_bitand, &); +X operator&(X, X); +X operator&(X, Y); +STATIC_ASSERT((has_bitand<int>::value)); +STATIC_ASSERT((has_bitand<int, long>::value)); +STATIC_ASSERT((!has_bitand<float>::value)); +STATIC_ASSERT((has_bitand<X>::value)); +STATIC_ASSERT((!has_bitand<int*, int>::value)); +STATIC_ASSERT((!has_bitand<int*>::value)); +STATIC_ASSERT((has_bitand<X, Y>::value)); +STATIC_ASSERT((!has_bitand<Y>::value)); +STATIC_ASSERT((!has_bitand<int X::*>::value)); + +// has_bitor +DEFINE_INFIX_BINARY_TRAIT(has_bitor, |); +X operator|(X, X); +X operator|(X, Y); +STATIC_ASSERT((has_bitor<int>::value)); +STATIC_ASSERT((has_bitor<int, long>::value)); +STATIC_ASSERT((!has_bitor<float>::value)); +STATIC_ASSERT((has_bitor<X>::value)); +STATIC_ASSERT((!has_bitor<int*, int>::value)); +STATIC_ASSERT((!has_bitor<int*>::value)); +STATIC_ASSERT((has_bitor<X, Y>::value)); +STATIC_ASSERT((!has_bitor<Y>::value)); +STATIC_ASSERT((!has_bitor<int X::*>::value)); + +// has_left_shift +DEFINE_INFIX_BINARY_TRAIT(has_left_shift, <<); +X operator<<(X, X); +X operator<<(X, Y); +STATIC_ASSERT((has_left_shift<int>::value)); +STATIC_ASSERT((has_left_shift<int, long>::value)); +STATIC_ASSERT((!has_left_shift<float>::value)); +STATIC_ASSERT((has_left_shift<X>::value)); +STATIC_ASSERT((!has_left_shift<int*, int>::value)); +STATIC_ASSERT((!has_left_shift<int*>::value)); +STATIC_ASSERT((has_left_shift<X, Y>::value)); +STATIC_ASSERT((!has_left_shift<Y>::value)); +STATIC_ASSERT((!has_left_shift<int X::*>::value)); + +// has_right_shift +DEFINE_INFIX_BINARY_TRAIT(has_right_shift, >>); +X operator>>(X, X); +X operator>>(X, Y); +STATIC_ASSERT((has_right_shift<int>::value)); +STATIC_ASSERT((has_right_shift<int, long>::value)); +STATIC_ASSERT((!has_right_shift<float>::value)); +STATIC_ASSERT((has_right_shift<X>::value)); +STATIC_ASSERT((!has_right_shift<int*, int>::value)); +STATIC_ASSERT((!has_right_shift<int*>::value)); +STATIC_ASSERT((has_right_shift<X, Y>::value)); +STATIC_ASSERT((!has_right_shift<Y>::value)); +STATIC_ASSERT((!has_right_shift<int X::*>::value)); + +// can_subscript +STATIC_ASSERT((can_subscript<int*, int>::value)); +STATIC_ASSERT((can_subscript<int, int*>::value)); +STATIC_ASSERT((can_subscript<int(&)[7], int>::value)); +STATIC_ASSERT((can_subscript<int, int(&)[7]>::value)); +STATIC_ASSERT((!can_subscript<X, Y>::value)); +STATIC_ASSERT((can_subscript<Y, X>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae8.C b/gcc/testsuite/g++.dg/template/sfinae8.C new file mode 100644 index 00000000000..2ad68dc5dbf --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae8.C @@ -0,0 +1,182 @@ +// DR 339 +// +// Test of the use of various boolean binary operators with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +bool accepts_bool(bool); + +#define DEFINE_BINARY_PREDICATE_TRAIT(Name,Op) \ +template<typename T, typename U> \ + typename enable_if<sizeof(accepts_bool(create_a<T>() Op create_a<U>())), \ + yes_type>::type \ + JOIN(check_,Name)(type<T>, type<U>); \ + \ +no_type JOIN(check_,Name)(...); \ + \ +template<typename T, typename U = T> \ +struct Name \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,Name)(type<T>(), type<U>())) == sizeof(yes_type)); \ +} + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct X { }; +struct Y { }; + +struct convertible_to_bool { + operator int convertible_to_bool::* (); +}; + +struct not_convertible_to_bool { }; + +// is_less_than_comparable +DEFINE_BINARY_PREDICATE_TRAIT(is_less_than_comparable,<); +bool operator<(X, X); +convertible_to_bool operator<(X, Y); +not_convertible_to_bool operator<(Y, X); + +STATIC_ASSERT((is_less_than_comparable<int>::value)); +STATIC_ASSERT((is_less_than_comparable<int, long>::value)); +STATIC_ASSERT((is_less_than_comparable<int*>::value)); +STATIC_ASSERT((is_less_than_comparable<X>::value)); +STATIC_ASSERT((is_less_than_comparable<X, Y>::value)); +STATIC_ASSERT((!is_less_than_comparable<Y, X>::value)); +STATIC_ASSERT((!is_less_than_comparable<Y>::value)); + +// is_less_equal_comparable +DEFINE_BINARY_PREDICATE_TRAIT(is_less_equal_comparable,<=); +bool operator<=(X, X); +convertible_to_bool operator<=(X, Y); +not_convertible_to_bool operator<=(Y, X); + +STATIC_ASSERT((is_less_equal_comparable<int>::value)); +STATIC_ASSERT((is_less_equal_comparable<int, long>::value)); +STATIC_ASSERT((is_less_equal_comparable<int*>::value)); +STATIC_ASSERT((is_less_equal_comparable<X>::value)); +STATIC_ASSERT((is_less_equal_comparable<X, Y>::value)); +STATIC_ASSERT((!is_less_equal_comparable<Y, X>::value)); +STATIC_ASSERT((!is_less_equal_comparable<Y>::value)); + +// is_greater_than_comparable +DEFINE_BINARY_PREDICATE_TRAIT(is_greater_than_comparable,>); +bool operator>(X, X); +convertible_to_bool operator>(X, Y); +not_convertible_to_bool operator>(Y, X); + +STATIC_ASSERT((is_greater_than_comparable<int>::value)); +STATIC_ASSERT((is_greater_than_comparable<int, long>::value)); +STATIC_ASSERT((is_greater_than_comparable<int*>::value)); +STATIC_ASSERT((is_greater_than_comparable<X>::value)); +STATIC_ASSERT((is_greater_than_comparable<X, Y>::value)); +STATIC_ASSERT((!is_greater_than_comparable<Y, X>::value)); +STATIC_ASSERT((!is_greater_than_comparable<Y>::value)); + +// is_greater_equal_comparable +DEFINE_BINARY_PREDICATE_TRAIT(is_greater_equal_comparable,>=); +bool operator>=(X, X); +convertible_to_bool operator>=(X, Y); +not_convertible_to_bool operator>=(Y, X); + +STATIC_ASSERT((is_greater_equal_comparable<int>::value)); +STATIC_ASSERT((is_greater_equal_comparable<int, long>::value)); +STATIC_ASSERT((is_greater_equal_comparable<int*>::value)); +STATIC_ASSERT((is_greater_equal_comparable<X>::value)); +STATIC_ASSERT((is_greater_equal_comparable<X, Y>::value)); +STATIC_ASSERT((!is_greater_equal_comparable<Y, X>::value)); +STATIC_ASSERT((!is_greater_equal_comparable<Y>::value)); + +// is_equality_comparable +struct Z : X { }; +DEFINE_BINARY_PREDICATE_TRAIT(is_equality_comparable,==); +bool operator==(X, X); +convertible_to_bool operator==(X, Y); +not_convertible_to_bool operator==(Y, X); + +STATIC_ASSERT((is_equality_comparable<int>::value)); +STATIC_ASSERT((is_equality_comparable<int, long>::value)); +STATIC_ASSERT((is_equality_comparable<int*>::value)); +STATIC_ASSERT((is_equality_comparable<X>::value)); +STATIC_ASSERT((is_equality_comparable<X, Y>::value)); +STATIC_ASSERT((!is_equality_comparable<Y, X>::value)); +STATIC_ASSERT((!is_equality_comparable<Y>::value)); +STATIC_ASSERT((is_equality_comparable<int X::*>::value)); +STATIC_ASSERT((!is_equality_comparable<int X::*, int Y::*>::value)); +STATIC_ASSERT((is_equality_comparable<int*, float*>::value)); +STATIC_ASSERT((is_equality_comparable<X*, Z*>::value)); +STATIC_ASSERT((!is_equality_comparable<X*, Y*>::value)); + +// is_not_equal_comparable +DEFINE_BINARY_PREDICATE_TRAIT(is_not_equal_comparable,!=); +bool operator!=(X, X); +convertible_to_bool operator!=(X, Y); +not_convertible_to_bool operator!=(Y, X); + +STATIC_ASSERT((is_not_equal_comparable<int>::value)); +STATIC_ASSERT((is_not_equal_comparable<int, long>::value)); +STATIC_ASSERT((is_not_equal_comparable<int*>::value)); +STATIC_ASSERT((is_not_equal_comparable<X>::value)); +STATIC_ASSERT((is_not_equal_comparable<X, Y>::value)); +STATIC_ASSERT((!is_not_equal_comparable<Y, X>::value)); +STATIC_ASSERT((!is_not_equal_comparable<Y>::value)); +STATIC_ASSERT((is_not_equal_comparable<int X::*>::value)); +STATIC_ASSERT((!is_not_equal_comparable<int X::*, int Y::*>::value)); +STATIC_ASSERT((is_not_equal_comparable<int*, float*>::value)); +STATIC_ASSERT((is_not_equal_comparable<X*, Z*>::value)); +STATIC_ASSERT((!is_not_equal_comparable<X*, Y*>::value)); + +// has_logical_and +DEFINE_BINARY_PREDICATE_TRAIT(has_logical_and,&&); +bool operator&&(X, X); +convertible_to_bool operator&&(X, Y); +not_convertible_to_bool operator&&(Y, X); + +STATIC_ASSERT((has_logical_and<int>::value)); +STATIC_ASSERT((has_logical_and<int, long>::value)); +STATIC_ASSERT((has_logical_and<int*>::value)); +STATIC_ASSERT((has_logical_and<X>::value)); +STATIC_ASSERT((has_logical_and<X, Y>::value)); +STATIC_ASSERT((!has_logical_and<Y, X>::value)); +STATIC_ASSERT((!has_logical_and<Y>::value)); +STATIC_ASSERT((has_logical_and<int X::*>::value)); +STATIC_ASSERT((has_logical_and<int X::*, int Y::*>::value)); +STATIC_ASSERT((has_logical_and<int*, float*>::value)); +STATIC_ASSERT((has_logical_and<X*, Z*>::value)); +STATIC_ASSERT((has_logical_and<X*, Y*>::value)); + +// has_logical_or +DEFINE_BINARY_PREDICATE_TRAIT(has_logical_or,||); +bool operator||(X, X); +convertible_to_bool operator||(X, Y); +not_convertible_to_bool operator||(Y, X); + +STATIC_ASSERT((has_logical_or<int>::value)); +STATIC_ASSERT((has_logical_or<int, long>::value)); +STATIC_ASSERT((has_logical_or<int*>::value)); +STATIC_ASSERT((has_logical_or<X>::value)); +STATIC_ASSERT((has_logical_or<X, Y>::value)); +STATIC_ASSERT((!has_logical_or<Y, X>::value)); +STATIC_ASSERT((!has_logical_or<Y>::value)); +STATIC_ASSERT((has_logical_or<int X::*>::value)); +STATIC_ASSERT((has_logical_or<int X::*, int Y::*>::value)); +STATIC_ASSERT((has_logical_or<int*, float*>::value)); +STATIC_ASSERT((has_logical_or<X*, Z*>::value)); +STATIC_ASSERT((has_logical_or<X*, Y*>::value)); diff --git a/gcc/testsuite/g++.dg/template/sfinae9.C b/gcc/testsuite/g++.dg/template/sfinae9.C new file mode 100644 index 00000000000..4e27ff61bd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae9.C @@ -0,0 +1,207 @@ +// DR 339 +// +// Test of the use of various assignment operators with SFINAE + +// Boilerplate helpers +typedef char yes_type; +struct no_type { char data[2]; }; + +template<typename T> T create_a(); +template<typename T> struct type { }; + +template<bool, typename T = void> struct enable_if { typedef T type; }; +template<typename T> struct enable_if<false, T> { }; + +#define JOIN( X, Y ) DO_JOIN( X, Y ) +#define DO_JOIN( X, Y ) DO_JOIN2(X,Y) +#define DO_JOIN2( X, Y ) X##Y + +#define DEFINE_INFIX_BINARY_TRAIT(Name,Op) \ +template<typename T, typename U> \ + typename enable_if<(sizeof(create_a<T>() Op create_a<U>(), 1) > 0), \ + yes_type>::type \ + JOIN(check_,Name)(type<T>, type<U>); \ + \ +no_type JOIN(check_,Name)(...); \ + \ +template<typename T, typename U = T> \ +struct Name \ +{ \ + static const bool value = \ + (sizeof(JOIN(check_,Name)(type<T&>(), type<U>())) == sizeof(yes_type)); \ +} + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr) +#else +# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1] +#endif + +struct Y { + Y& operator=(Y&); +}; + +struct X { + X& operator=(Y); + X& operator+=(X); + X& operator-=(X); + X& operator*=(X); + X& operator/=(X); + X& operator%=(X); + X& operator^=(X); + X& operator&=(X); + X& operator|=(X); + X& operator<<=(X); + X& operator>>=(X); +}; +struct Z { }; + +// is_assignable +DEFINE_INFIX_BINARY_TRAIT(is_assignable, =); +STATIC_ASSERT((is_assignable<int>::value)); +STATIC_ASSERT((is_assignable<int, long>::value)); +STATIC_ASSERT((is_assignable<X>::value)); +STATIC_ASSERT((!is_assignable<int*, int>::value)); +STATIC_ASSERT((is_assignable<int*>::value)); +STATIC_ASSERT((is_assignable<X, Y>::value)); +STATIC_ASSERT((!is_assignable<X, Z>::value)); +STATIC_ASSERT((!is_assignable<Y>::value)); +STATIC_ASSERT((!is_assignable<const int, long>::value)); + +// has_plus_assign +DEFINE_INFIX_BINARY_TRAIT(has_plus_assign, +=); +X& operator+=(X&, Y); +STATIC_ASSERT((has_plus_assign<int>::value)); +STATIC_ASSERT((has_plus_assign<int, long>::value)); +STATIC_ASSERT((has_plus_assign<X>::value)); +STATIC_ASSERT((has_plus_assign<int*, int>::value)); +STATIC_ASSERT((!has_plus_assign<int*>::value)); +STATIC_ASSERT((has_plus_assign<X, Y>::value)); +STATIC_ASSERT((!has_plus_assign<X, Z>::value)); +STATIC_ASSERT((!has_plus_assign<Y>::value)); +STATIC_ASSERT((!has_plus_assign<const int, long>::value)); + +// has_minus_assign +DEFINE_INFIX_BINARY_TRAIT(has_minus_assign, -=); +X& operator-=(X&, Y); +STATIC_ASSERT((has_minus_assign<int>::value)); +STATIC_ASSERT((has_minus_assign<int, long>::value)); +STATIC_ASSERT((has_minus_assign<X>::value)); +STATIC_ASSERT((has_minus_assign<int*, int>::value)); +STATIC_ASSERT((!has_minus_assign<int*>::value)); +STATIC_ASSERT((has_minus_assign<X, Y>::value)); +STATIC_ASSERT((!has_minus_assign<X, Z>::value)); +STATIC_ASSERT((!has_minus_assign<Y>::value)); +STATIC_ASSERT((!has_minus_assign<int X::*>::value)); +STATIC_ASSERT((!has_minus_assign<const int, long>::value)); + +// has_multiply_assign +DEFINE_INFIX_BINARY_TRAIT(has_multiply_assign, *=); +X& operator*=(X&, Y); +STATIC_ASSERT((has_multiply_assign<int>::value)); +STATIC_ASSERT((has_multiply_assign<int, long>::value)); +STATIC_ASSERT((has_multiply_assign<X>::value)); +STATIC_ASSERT((!has_multiply_assign<int*, int>::value)); +STATIC_ASSERT((!has_multiply_assign<int*>::value)); +STATIC_ASSERT((has_multiply_assign<X, Y>::value)); +STATIC_ASSERT((!has_multiply_assign<X, Z>::value)); +STATIC_ASSERT((!has_multiply_assign<Y>::value)); +STATIC_ASSERT((!has_multiply_assign<int X::*>::value)); +STATIC_ASSERT((!has_multiply_assign<const int, long>::value)); + +// has_divide_assign +DEFINE_INFIX_BINARY_TRAIT(has_divide_assign, /=); +X& operator/=(X&, Y); +STATIC_ASSERT((has_divide_assign<int>::value)); +STATIC_ASSERT((has_divide_assign<int, long>::value)); +STATIC_ASSERT((has_divide_assign<X>::value)); +STATIC_ASSERT((!has_divide_assign<int*, int>::value)); +STATIC_ASSERT((!has_divide_assign<int*>::value)); +STATIC_ASSERT((has_divide_assign<X, Y>::value)); +STATIC_ASSERT((!has_divide_assign<X, Z>::value)); +STATIC_ASSERT((!has_divide_assign<Y>::value)); +STATIC_ASSERT((!has_divide_assign<int X::*>::value)); + +// has_remainder_assign +DEFINE_INFIX_BINARY_TRAIT(has_remainder_assign, %=); +X& operator%=(X&, Y); +STATIC_ASSERT((has_remainder_assign<int>::value)); +STATIC_ASSERT((has_remainder_assign<int, long>::value)); +STATIC_ASSERT((!has_remainder_assign<float>::value)); +STATIC_ASSERT((has_remainder_assign<X>::value)); +STATIC_ASSERT((!has_remainder_assign<int*, int>::value)); +STATIC_ASSERT((!has_remainder_assign<int*>::value)); +STATIC_ASSERT((has_remainder_assign<X, Y>::value)); +STATIC_ASSERT((!has_remainder_assign<X, Z>::value)); +STATIC_ASSERT((!has_remainder_assign<Y>::value)); +STATIC_ASSERT((!has_remainder_assign<int X::*>::value)); + +// has_xor_assign +DEFINE_INFIX_BINARY_TRAIT(has_xor_assign, ^=); +X& operator^=(X&, Y); +STATIC_ASSERT((has_xor_assign<int>::value)); +STATIC_ASSERT((has_xor_assign<int, long>::value)); +STATIC_ASSERT((!has_xor_assign<float>::value)); +STATIC_ASSERT((has_xor_assign<X>::value)); +STATIC_ASSERT((!has_xor_assign<int*, int>::value)); +STATIC_ASSERT((!has_xor_assign<int*>::value)); +STATIC_ASSERT((has_xor_assign<X, Y>::value)); +STATIC_ASSERT((!has_xor_assign<X, Z>::value)); +STATIC_ASSERT((!has_xor_assign<Y>::value)); +STATIC_ASSERT((!has_xor_assign<int X::*>::value)); + +// has_bitand_assign +DEFINE_INFIX_BINARY_TRAIT(has_bitand_assign, &=); +X& operator&=(X&, Y); +STATIC_ASSERT((has_bitand_assign<int>::value)); +STATIC_ASSERT((has_bitand_assign<int, long>::value)); +STATIC_ASSERT((!has_bitand_assign<float>::value)); +STATIC_ASSERT((has_bitand_assign<X>::value)); +STATIC_ASSERT((!has_bitand_assign<int*, int>::value)); +STATIC_ASSERT((!has_bitand_assign<int*>::value)); +STATIC_ASSERT((has_bitand_assign<X, Y>::value)); +STATIC_ASSERT((!has_bitand_assign<X, Z>::value)); +STATIC_ASSERT((!has_bitand_assign<Y>::value)); +STATIC_ASSERT((!has_bitand_assign<int X::*>::value)); + +// has_bitor_assign +DEFINE_INFIX_BINARY_TRAIT(has_bitor_assign, |=); +X& operator|=(X&, Y); +STATIC_ASSERT((has_bitor_assign<int>::value)); +STATIC_ASSERT((has_bitor_assign<int, long>::value)); +STATIC_ASSERT((!has_bitor_assign<float>::value)); +STATIC_ASSERT((has_bitor_assign<X>::value)); +STATIC_ASSERT((!has_bitor_assign<int*, int>::value)); +STATIC_ASSERT((!has_bitor_assign<int*>::value)); +STATIC_ASSERT((has_bitor_assign<X, Y>::value)); +STATIC_ASSERT((!has_bitor_assign<X, Z>::value)); +STATIC_ASSERT((!has_bitor_assign<Y>::value)); +STATIC_ASSERT((!has_bitor_assign<int X::*>::value)); + +// has_left_shift_assign +DEFINE_INFIX_BINARY_TRAIT(has_left_shift_assign, <<=); +X& operator<<=(X&, Y); +STATIC_ASSERT((has_left_shift_assign<int>::value)); +STATIC_ASSERT((has_left_shift_assign<int, long>::value)); +STATIC_ASSERT((!has_left_shift_assign<float>::value)); +STATIC_ASSERT((has_left_shift_assign<X>::value)); +STATIC_ASSERT((!has_left_shift_assign<int*, int>::value)); +STATIC_ASSERT((!has_left_shift_assign<int*>::value)); +STATIC_ASSERT((has_left_shift_assign<X, Y>::value)); +STATIC_ASSERT((!has_left_shift_assign<X, Z>::value)); +STATIC_ASSERT((!has_left_shift_assign<Y>::value)); +STATIC_ASSERT((!has_left_shift_assign<int X::*>::value)); + +// has_right_shift_assign +DEFINE_INFIX_BINARY_TRAIT(has_right_shift_assign, >>=); +X& operator>>=(X&, Y); +STATIC_ASSERT((has_right_shift_assign<int>::value)); +STATIC_ASSERT((has_right_shift_assign<int, long>::value)); +STATIC_ASSERT((!has_right_shift_assign<float>::value)); +STATIC_ASSERT((has_right_shift_assign<X>::value)); +STATIC_ASSERT((!has_right_shift_assign<int*, int>::value)); +STATIC_ASSERT((!has_right_shift_assign<int*>::value)); +STATIC_ASSERT((has_right_shift_assign<X, Y>::value)); +STATIC_ASSERT((!has_right_shift_assign<X, Z>::value)); +STATIC_ASSERT((!has_right_shift_assign<Y>::value)); +STATIC_ASSERT((!has_right_shift_assign<int X::*>::value)); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c index 5de797a5297..8300320c8cf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-store_ccp" } */ - +/* { dg-options "-O2 -fdump-tree-dce1" } */ +void bar (int i, int partial, int args_addr) { int offset = 0; @@ -13,5 +13,5 @@ bar (int i, int partial, int args_addr) /* There should be only one IF conditional since the first does nothing useful. */ -/* { dg-final { scan-tree-dump-times "if " 1 "store_ccp"} } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dce1"} } */ +/* { dg-final { cleanup-tree-dump "dce1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c index de3b5c122e0..eb1f5ec7d68 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-store_ccp" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ extern int board[]; @@ -15,5 +15,5 @@ findbestextension (int blah, int blah2) } /* The argument to "foo" should be a variable, not a constant. */ -/* { dg-final { scan-tree-dump-times "foo .defval" 1 "store_ccp"} } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* { dg-final { scan-tree-dump-times "foo .defval" 1 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c index 6e6bfe95b9b..e74bd08da90 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */ +/* { dg-options "-O -fdump-tree-ccp1" } */ extern int printf (const char *, ...); @@ -20,5 +20,5 @@ main () /* The argument to "printf" should be a constant, not a variable. */ -/* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "store_ccp"} } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "ccp1"} } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c index 66fcae5a97a..1a6e36df8f1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c @@ -1,11 +1,14 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp-vops" } */ +/* { dg-do link } */ +/* { dg-options "-O2" } */ /* Test to check whether global variables are being constant propagated. */ +extern void link_error (void); + int G; +void foo (int i) { if (i > 0) @@ -17,12 +20,10 @@ foo (int i) link_error (); } +int main () { foo (0); return 0; } -/* There should be no G on the RHS of an assignment. */ -/* { dg-final { scan-tree-dump-times "= G;" 0 "store_ccp"} } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c index 6e3a5fb2ec4..fc33d74e9ff 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */ +/* { dg-options "-O -fdump-tree-fre-details" } */ int foo (int *p) @@ -8,6 +8,6 @@ foo (int *p) return *p; } -/* The store to *p should be propagated to the return statement. */ -/* { dg-final { scan-tree-dump-times "return 0" 1 "store_ccp" } } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* The store to *p should be propagated to the load statement. */ +/* { dg-final { scan-tree-dump "Replaced \\\*p_.\\\(D\\\) with 0" "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c index d662ef6e35b..82f37abc875 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-store_ccp" } */ +/* { dg-options "-O -fdump-tree-ccp1" } */ extern void link_error (void); @@ -71,5 +71,5 @@ void test11111 (int p, int q, int r) /* There should be not link_error calls, if there is any the optimization has failed */ -/* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp1"} } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c index fe152b7e01e..86a706b80ef 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c @@ -1,10 +1,12 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-store_ccp" } */ +/* { dg-options "-O -fdump-tree-ccp2" } */ extern void link_error (void); -/* some addresses clearly cannot be equal, check that some address - expressions can be evaluated as constants */ +/* Some addresses clearly cannot be equal, check that some address + expressions can be evaluated as constants. + Most of the tests are folding tests, but at least some require + points-to analysis, so we scan the first CCP dump after PTA. */ char g1, g2; void test6 (char p1, char p2) @@ -131,5 +133,5 @@ int* test666 (int * __restrict__ rp1, int * __restrict__ rp2, int *p1) optimization has failed */ /* ??? While we indeed don't handle some of these, a couple of the restrict tests are incorrect. */ -/* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp" { xfail *-*-* } } } */ -/* { dg-final { cleanup-tree-dump "store_ccp" } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp2" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "ccp2" } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c index baf5f163960..3a444bf90aa 100644 --- a/gcc/testsuite/gcc.target/i386/sse-13.c +++ b/gcc/testsuite/gcc.target/i386/sse-13.c @@ -1,6 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -msse4 -msse5" } */ +#include <mm_malloc.h> + /* Test that the intrinsics compile with optimization. All of them are defined as inline functions in {,x,e,p,t,s,a,b}mmintrin.h and mm3dnow.h that reference the proper builtin functions. Defining away "extern" and diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index 708313dab84..286748a8594 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -1,6 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -msse4 -msse5" } */ +#include <mm_malloc.h> + /* Test that the intrinsics compile without optimization. All of them are defined as inline functions in {,x,e,p,t,s,a,b}mmintrin.h and mm3dnow.h that reference the proper builtin functions. Defining away "extern" and diff --git a/gcc/testsuite/gcc.target/mips/pr35232.c b/gcc/testsuite/gcc.target/mips/pr35232.c new file mode 100644 index 00000000000..c0e0649b52e --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/pr35232.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ +/* { dg-mips-options "-O" } */ + +NOMIPS16 unsigned int +f1 (unsigned long long x) +{ + unsigned int r; + asm ("# %0" : "=a" (r) : "0" (x)); + asm ("# %0" : "=h" (r) : "0" (r)); + return r; +} + +int +main (void) +{ + return f1 (4) != 4; +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-bclr.c b/gcc/testsuite/gcc.target/sh/sh2a-bclr.c new file mode 100644 index 00000000000..d4e11f95298 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-bclr.c @@ -0,0 +1,57 @@ +/* Testcase to check generation of a SH2A specific instruction + 'BCLR #imm3,Rn'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "bclr"} } */ + +struct a +{ + char a, b; + short c; +}; + +/* This function generates the instruction "BCLR #imm3,Rn" only + on using optimization option "-O1" and above. */ + +int +a2 () +{ + volatile int j; + volatile static struct a x = {1, 66, ~1}, y = {1, 2, ~2}; + + if (j > 1) + return (x.a == y.a && (x.b & ~1) == y.b); + if (j > 2) + return (x.a == y.a && (x.b & ~2) == y.b); + if (j > 3) + return (x.a == y.a && (x.b & ~4) == y.b); + if (j > 4) + return (x.a == y.a && (x.b & ~8) == y.b); + if (j > 5) + return (x.a == y.a && (x.b & ~16) == y.b); + if (j > 6) + return (x.a == y.a && (x.b & ~32) == y.b); + if (j > 7) + return (x.a == y.a && (x.b & ~64) == y.b); + if (j > 8) + return (x.a == y.a && (x.b & ~128) == y.b); +} + +int +main () +{ + volatile unsigned char x; + + x &= 0xFE; + x &= 0xFD; + x &= 0xFB; + x &= 0xF7; + x &= 0xEF; + x &= 0xDF; + x &= 0xBF; + x &= 0x7F; + + if (!a2 ()) + return 0; +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-bset.c b/gcc/testsuite/gcc.target/sh/sh2a-bset.c new file mode 100644 index 00000000000..b64852b4c36 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-bset.c @@ -0,0 +1,57 @@ +/* Testcase to check generation of a SH2A specific instruction + 'BSET #imm3,Rn'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "bset"} } */ + +struct a +{ + char a, b; + short c; +}; + +/* This function generates the instruction "BSET #imm3,Rn" only + on using optimization option "-O1" and above. */ + +int +a2 () +{ + volatile int j; + volatile static struct a x = {1, 66, ~1}, y = {1, 2, ~2}; + + if (j > 1) + return (x.a == y.a && (x.b | 1) == y.b); + if (j > 2) + return (x.a == y.a && (x.b | 2) == y.b); + if (j > 3) + return (x.a == y.a && (x.b | 4) == y.b); + if (j > 4) + return (x.a == y.a && (x.b | 8) == y.b); + if (j > 5) + return (x.a == y.a && (x.b | 16) == y.b); + if (j > 6) + return (x.a == y.a && (x.b | 32) == y.b); + if (j > 7) + return (x.a == y.a && (x.b | 64) == y.b); + if (j > 8) + return (x.a == y.a && (x.b | 128) == y.b); +} + +int +main () +{ + volatile unsigned char x; + + x |= 0x1; + x |= 0x2; + x |= 0x4; + x |= 0x8; + x |= 0x16; + x |= 0x32; + x |= 0x64; + x |= 0x128; + + if (!a2 ()) + return 0; +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c b/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c new file mode 100644 index 00000000000..9b9b92cb920 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c @@ -0,0 +1,15 @@ +/* Testcase to check generation of a SH2A specific instruction for + 'JSR/N @Rm'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O0" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "jsr/n"} } */ + +void foo(void) +{ +} + +void bar() +{ + foo(); +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c b/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c new file mode 100644 index 00000000000..55d2f665b3b --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c @@ -0,0 +1,14 @@ +/* Testcase to check generation of 'MOVI20S #imm20, Rn'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O0" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "movi20s"} } */ + +volatile long la; + +void +testfun (void) +{ + la = -134217728; + la = 134217216; +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-movrt.c b/gcc/testsuite/gcc.target/sh/sh2a-movrt.c new file mode 100644 index 00000000000..9df9f4ba976 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-movrt.c @@ -0,0 +1,15 @@ +/* Testcase to check generation of a SH2A specific instruction for + 'MOVRT Rn'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "movrt"} } */ + +int +foo (void) +{ + int a, b, g, stop; + if (stop = ((a + b) % 2 != g)) + ; + return stop; +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-prefetch.c b/gcc/testsuite/gcc.target/sh/sh2a-prefetch.c new file mode 100644 index 00000000000..e0c9a0d7dc6 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-prefetch.c @@ -0,0 +1,34 @@ +/* Testcase to check generation of a SH2A specific instruction PREF @Rm. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O0" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "pref"} } */ + +void +opt (void) +{ + int *p, wk; + int data[100]; + + /* data prefetch , instructions hit the cache. */ + + __builtin_prefetch (&data[0], 0, 0); + __builtin_prefetch (&data[0], 0, 1); + __builtin_prefetch (&data[0], 0, 2); + __builtin_prefetch (&data[0], 0, 3); + __builtin_prefetch (&data[0], 1, 0); + __builtin_prefetch (&data[0], 1, 1); + __builtin_prefetch (&data[0], 1, 2); + __builtin_prefetch (&data[0], 1, 3); + + + for (p = &data[0]; p < &data[9]; p++) + { + if (*p > *(p + 1)) + { + wk = *p; + *p = *(p + 1); + *(p + 1) = wk; + } + } +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-resbank.c b/gcc/testsuite/gcc.target/sh/sh2a-resbank.c new file mode 100644 index 00000000000..aab6852f336 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-resbank.c @@ -0,0 +1,12 @@ +/* Test for resbank attribute. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "resbank" } } */ + +extern void bar(void); + +void foo(void) __attribute__((interrupt_handler, resbank)); +void foo(void) +{ + bar(); +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c b/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c new file mode 100644 index 00000000000..2601ced5cff --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c @@ -0,0 +1,11 @@ +/* Testcase to check generation of a SH2A specific instruction for + 'RTS/N'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O0" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "rts/n"} } */ + +void +bar (void) +{ +} diff --git a/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c b/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c new file mode 100644 index 00000000000..8029b03dd4a --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c @@ -0,0 +1,22 @@ +/* Testcase to check generation of a SH2A specific, + TBR relative jump instruction - 'JSR @@(disp8,TBR)'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler-times "jsr/n\\t@@\\(40,tbr\\)" 1} } */ +/* { dg-final { scan-assembler-times "jsr/n\\t@@\\(72,tbr\\)" 1} } */ + +extern void foo1 (void) __attribute__ ((function_vector(10))); +extern void foo2 (void); +extern int bar1 (void) __attribute__ ((function_vector(18))); +extern int bar2 (void); + +int +bar() +{ + foo1(); + foo2(); + + bar1(); + bar2(); +} diff --git a/gcc/testsuite/gnat.dg/forward_anon.adb b/gcc/testsuite/gnat.dg/forward_anon.adb new file mode 100644 index 00000000000..bce495e228e --- /dev/null +++ b/gcc/testsuite/gnat.dg/forward_anon.adb @@ -0,0 +1,8 @@ +-- { dg-do compile } + +package body Forward_Anon is + function Get_Current return access Object is + begin + return Current_Object; + end; +end; diff --git a/gcc/testsuite/gnat.dg/forward_anon.ads b/gcc/testsuite/gnat.dg/forward_anon.ads new file mode 100644 index 00000000000..ff68ff400d3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/forward_anon.ads @@ -0,0 +1,9 @@ +package Forward_Anon is + type Object is null record; + function Get_Current return access Object; + Current_Object : constant access Object; + + private + One_Object : aliased Object; + Current_Object : constant access Object := One_Object'Access; +end; diff --git a/gcc/testsuite/gnat.dg/iface1.ads b/gcc/testsuite/gnat.dg/iface1.ads new file mode 100644 index 00000000000..bfe90a30320 --- /dev/null +++ b/gcc/testsuite/gnat.dg/iface1.ads @@ -0,0 +1,12 @@ +generic + type Data is private; +package Iface1 is + type Future is synchronized interface; + type Any_Future is access all Future; + + procedure Get (This : in out Future; P : out Data) is abstract; + procedure Set (This : in out Future; P : in Data) is abstract; + + type Reusable_Future is synchronized interface and Future; + type Any_Reusable_Future is access all Reusable_Future'Class; +end Iface1; diff --git a/gcc/testsuite/gnat.dg/iface2.adb b/gcc/testsuite/gnat.dg/iface2.adb new file mode 100644 index 00000000000..c565599521e --- /dev/null +++ b/gcc/testsuite/gnat.dg/iface2.adb @@ -0,0 +1,7 @@ +-- { dg-do compile } +package body Iface2 is + procedure change (This, That : Prot.Any_Future) is + begin + null; + end; +end Iface2; diff --git a/gcc/testsuite/gnat.dg/iface2.ads b/gcc/testsuite/gnat.dg/iface2.ads new file mode 100644 index 00000000000..d25bc4246c0 --- /dev/null +++ b/gcc/testsuite/gnat.dg/iface2.ads @@ -0,0 +1,6 @@ +with Iface1; +generic + with package Prot is new Iface1 (<>); +package Iface2 is + procedure change (This, That : Prot.Any_Future); +end Iface2; diff --git a/gcc/testsuite/gnat.dg/init_scalar1.adb b/gcc/testsuite/gnat.dg/init_scalar1.adb new file mode 100644 index 00000000000..2688e929896 --- /dev/null +++ b/gcc/testsuite/gnat.dg/init_scalar1.adb @@ -0,0 +1,16 @@ +-- { dg-do run } +-- { dg-options "-gnatws -gnatVa" } + +pragma Initialize_Scalars; +procedure init_scalar1 is + type Fixed_3T is delta 2.0 ** (- 4) + range - 2.0 ** 19 .. (2.0 ** 19 - 2.0 ** (- 4)); + for Fixed_3T'Size use 3*8; + + Write_Value : constant Fixed_3T := Fixed_3T(524287.875); + type singleton is array (1 .. 1) of Fixed_3T; + pragma Pack (singleton); + it : Singleton; +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/self1.adb b/gcc/testsuite/gnat.dg/self1.adb new file mode 100644 index 00000000000..dc6f485b8fe --- /dev/null +++ b/gcc/testsuite/gnat.dg/self1.adb @@ -0,0 +1,21 @@ +-- { dg-do compile } + +procedure Self1 is + type Event; + + type Link (E : access Event) is limited record + Val : Integer; + end record; + + type Ptr is access all Event; + + type Event is tagged limited record + Inner : Link (Event'access); + Size : Integer; + end record; + + Obj2 : Ptr := new Event'(Inner => (Event'access, 15), + Size => Link'size); +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/specs/restricted_pkg.ads b/gcc/testsuite/gnat.dg/specs/restricted_pkg.ads new file mode 100644 index 00000000000..cfd84699426 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/restricted_pkg.ads @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-gnatc" } + +pragma Restrictions (No_Entry_Queue); +package Restricted_Pkg is + type Iface is limited interface; + protected type PO is new Iface with + procedure Dummy; + end; +end; diff --git a/gcc/testsuite/gnat.dg/test_bip_no_alloc.adb b/gcc/testsuite/gnat.dg/test_bip_no_alloc.adb new file mode 100644 index 00000000000..82973147e3a --- /dev/null +++ b/gcc/testsuite/gnat.dg/test_bip_no_alloc.adb @@ -0,0 +1,24 @@ +-- { dg-do compile } + +pragma Restrictions (No_Allocators); +procedure Test_BIP_No_Alloc is + + type LR (B : Boolean) is limited record + X : Integer; + end record; + + function FLR return LR is + begin + -- A return statement in a function with a limited and unconstrained + -- result subtype can result in expansion of an allocator for the + -- secondary stack, but that should not result in a violation of the + -- restriction No_Allocators. + + return (B => False, X => 123); + end FLR; + + Obj : LR := FLR; + +begin + null; +end Test_BIP_No_Alloc; diff --git a/gcc/testsuite/gnat.dg/too_many_tasks.adb b/gcc/testsuite/gnat.dg/too_many_tasks.adb new file mode 100644 index 00000000000..5d01570d634 --- /dev/null +++ b/gcc/testsuite/gnat.dg/too_many_tasks.adb @@ -0,0 +1,25 @@ +-- { dg-do run } + +procedure too_many_tasks is + Global : Natural := 0; + function Output return Integer is + begin + Global := Global + 1; + return Global; + end Output; + + task type A; + task type B; + + task body A is + I : Integer := Output; + T : B; + begin null; end A; + + task body B is + I : Integer := Output; + T : A; + begin null; end B; + + T : A; +begin null; end; diff --git a/gcc/testsuite/objc.dg/method-20.m b/gcc/testsuite/objc.dg/method-20.m new file mode 100644 index 00000000000..653e047281d --- /dev/null +++ b/gcc/testsuite/objc.dg/method-20.m @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +/* We used to crash after we found the type for int[m] was declared as invalid. */ +/* PR objc/29197 */ + +@ implementation NGActiveSocket ++ (void) socketPair:(int[m]) _pair {} /* { dg-error "" } */ +@end diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index fddd1dc71d0..03d1ba5ee5d 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -942,7 +942,6 @@ bool fold_stmt (tree *); bool fold_stmt_inplace (tree); tree get_symbol_constant_value (tree); tree fold_const_aggregate_ref (tree); -tree widen_bitfield (tree, tree, tree); /* In tree-vrp.c */ tree vrp_evaluate_conditional (tree, tree); diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 805776ac25c..8dcc759eb7d 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1264,50 +1264,6 @@ visit_assignment (tree stmt, tree *output_p) /* Evaluate the statement. */ val = evaluate_stmt (stmt); - /* If the original LHS was a VIEW_CONVERT_EXPR, modify the constant - value to be a VIEW_CONVERT_EXPR of the old constant value. - - ??? Also, if this was a definition of a bitfield, we need to widen - the constant value into the type of the destination variable. This - should not be necessary if GCC represented bitfields properly. */ - { - tree orig_lhs = GIMPLE_STMT_OPERAND (stmt, 0); - - if (TREE_CODE (orig_lhs) == VIEW_CONVERT_EXPR - && val.lattice_val == CONSTANT) - { - tree w = fold_unary (VIEW_CONVERT_EXPR, - TREE_TYPE (TREE_OPERAND (orig_lhs, 0)), - val.value); - - orig_lhs = TREE_OPERAND (orig_lhs, 0); - if (w && is_gimple_min_invariant (w)) - val.value = w; - else - { - val.lattice_val = VARYING; - val.value = NULL; - } - } - - if (val.lattice_val == CONSTANT - && TREE_CODE (orig_lhs) == COMPONENT_REF - && DECL_BIT_FIELD (TREE_OPERAND (orig_lhs, 1))) - { - tree w = widen_bitfield (val.value, TREE_OPERAND (orig_lhs, 1), - orig_lhs); - - if (w && is_gimple_min_invariant (w)) - val.value = w; - else - { - val.lattice_val = VARYING; - val.value = NULL_TREE; - val.mem_ref = NULL_TREE; - } - } - } - retval = SSA_PROP_NOT_INTERESTING; /* Set the lattice value of the statement's output. */ @@ -1535,64 +1491,6 @@ struct gimple_opt_pass pass_store_ccp = } }; -/* Given a constant value VAL for bitfield FIELD, and a destination - variable VAR, return VAL appropriately widened to fit into VAR. If - FIELD is wider than HOST_WIDE_INT, NULL is returned. */ - -tree -widen_bitfield (tree val, tree field, tree var) -{ - unsigned HOST_WIDE_INT var_size, field_size; - tree wide_val; - unsigned HOST_WIDE_INT mask; - unsigned int i; - - /* We can only do this if the size of the type and field and VAL are - all constants representable in HOST_WIDE_INT. */ - if (!host_integerp (TYPE_SIZE (TREE_TYPE (var)), 1) - || !host_integerp (DECL_SIZE (field), 1) - || !host_integerp (val, 0)) - return NULL_TREE; - - var_size = tree_low_cst (TYPE_SIZE (TREE_TYPE (var)), 1); - field_size = tree_low_cst (DECL_SIZE (field), 1); - - /* Give up if either the bitfield or the variable are too wide. */ - if (field_size > HOST_BITS_PER_WIDE_INT || var_size > HOST_BITS_PER_WIDE_INT) - return NULL_TREE; - - gcc_assert (var_size >= field_size); - - /* If the sign bit of the value is not set or the field's type is unsigned, - just mask off the high order bits of the value. */ - if (DECL_UNSIGNED (field) - || !(tree_low_cst (val, 0) & (((HOST_WIDE_INT)1) << (field_size - 1)))) - { - /* Zero extension. Build a mask with the lower 'field_size' bits - set and a BIT_AND_EXPR node to clear the high order bits of - the value. */ - for (i = 0, mask = 0; i < field_size; i++) - mask |= ((HOST_WIDE_INT) 1) << i; - - wide_val = fold_build2 (BIT_AND_EXPR, TREE_TYPE (var), val, - build_int_cst (TREE_TYPE (var), mask)); - } - else - { - /* Sign extension. Create a mask with the upper 'field_size' - bits set and a BIT_IOR_EXPR to set the high order bits of the - value. */ - for (i = 0, mask = 0; i < (var_size - field_size); i++) - mask |= ((HOST_WIDE_INT) 1) << (var_size - i - 1); - - wide_val = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (var), val, - build_int_cst (TREE_TYPE (var), mask)); - } - - return wide_val; -} - - /* A subroutine of fold_stmt_r. Attempts to fold *(A+O) to A[X]. BASE is an array type. OFFSET is a byte displacement. ORIG_TYPE is the desired result type. */ diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 64ff4efca85..909bfeba682 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1595,38 +1595,13 @@ record_equivalences_from_stmt (tree stmt, int may_optimize_p, stmt_ann_t ann) tree rhs = GIMPLE_STMT_OPERAND (stmt, 1); tree new_stmt; - /* FIXME: If the LHS of the assignment is a bitfield and the RHS - is a constant, we need to adjust the constant to fit into the - type of the LHS. If the LHS is a bitfield and the RHS is not - a constant, then we can not record any equivalences for this - statement since we would need to represent the widening or - narrowing of RHS. This fixes gcc.c-torture/execute/921016-1.c - and should not be necessary if GCC represented bitfields - properly. */ - if (lhs_code == COMPONENT_REF - && DECL_BIT_FIELD (TREE_OPERAND (lhs, 1))) - { - if (TREE_CONSTANT (rhs)) - rhs = widen_bitfield (rhs, TREE_OPERAND (lhs, 1), lhs); - else - rhs = NULL; - - /* If the value overflowed, then we can not use this equivalence. */ - if (rhs && ! is_gimple_min_invariant (rhs)) - rhs = NULL; - } - - if (rhs) - { - /* Build a new statement with the RHS and LHS exchanged. */ - new_stmt = build_gimple_modify_stmt (rhs, lhs); - - create_ssa_artificial_load_stmt (new_stmt, stmt, true); + /* Build a new statement with the RHS and LHS exchanged. */ + new_stmt = build_gimple_modify_stmt (rhs, lhs); + create_ssa_artificial_load_stmt (new_stmt, stmt, true); - /* Finally enter the statement into the available expression - table. */ - lookup_avail_expr (new_stmt, true); - } + /* Finally enter the statement into the available expression + table. */ + lookup_avail_expr (new_stmt, true); } } diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 61599c7b720..b6f0b691e5c 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,20 @@ +2008-03-26 Daniel Jacobowitz <dan@debian.org> + + * src/arm/sysv.S: Fix ARM comment marker. + +2008-03-26 Jakub Jelinek <jakub@redhat.com> + + * src/alpha/osf.S: Add .note.GNU-stack on Linux. + * src/s390/sysv.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + * src/x86/unix64.S: Likewise. + * src/x86/sysv.S: Likewise. + * src/sparc/v8.S: Likewise. + * src/sparc/v9.S: Likewise. + * src/m68k/sysv.S: Likewise. + * src/arm/sysv.S: Likewise. + 2008-03-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * aclocal.m4: Regenerate. diff --git a/libffi/src/alpha/osf.S b/libffi/src/alpha/osf.S index aba6782e794..a6a7b1fc249 100644 --- a/libffi/src/alpha/osf.S +++ b/libffi/src/alpha/osf.S @@ -358,4 +358,8 @@ $LASFDE3: .byte 16 # uleb128 offset 16*-8 .align 3 $LEFDE3: + +#ifdef __linux__ + .section .note.GNU-stack,"",@progbits +#endif #endif diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index 12876d12054..7062addef18 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -293,3 +293,6 @@ ARM_FUNC_START ffi_closure_SYSV UNWIND .fnend .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S index d2a4ff1c64a..3face83837c 100644 --- a/libffi/src/m68k/sysv.S +++ b/libffi/src/m68k/sysv.S @@ -207,3 +207,7 @@ ffi_closure_struct_SYSV: rts CFI_ENDPROC() .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S index c9f5742f5aa..f65784bab1f 100644 --- a/libffi/src/powerpc/ppc_closure.S +++ b/libffi/src/powerpc/ppc_closure.S @@ -295,3 +295,7 @@ END(ffi_closure_SYSV) .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/powerpc/sysv.S b/libffi/src/powerpc/sysv.S index 21367145eb9..d402067aab0 100644 --- a/libffi/src/powerpc/sysv.S +++ b/libffi/src/powerpc/sysv.S @@ -223,3 +223,7 @@ END(ffi_call_SYSV) .align 2 .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/s390/sysv.S b/libffi/src/s390/sysv.S index e9cbed977a9..09cdec14ac4 100644 --- a/libffi/src/s390/sysv.S +++ b/libffi/src/s390/sysv.S @@ -427,3 +427,6 @@ ffi_closure_SYSV: #endif +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/sparc/v8.S b/libffi/src/sparc/v8.S index 709423ce906..1d7bfa51daa 100644 --- a/libffi/src/sparc/v8.S +++ b/libffi/src/sparc/v8.S @@ -265,3 +265,7 @@ done2: .byte 0x1f ! uleb128 0x1f .align WS .LLEFDE2: + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S index d640e0232d5..a8e8bf98d1e 100644 --- a/libffi/src/sparc/v9.S +++ b/libffi/src/sparc/v9.S @@ -300,3 +300,7 @@ longdouble1: .align 8 .LLEFDE2: #endif + +#ifdef __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index a0daf1dca94..4e652207edf 100644 --- a/libffi/src/x86/sysv.S +++ b/libffi/src/x86/sysv.S @@ -430,3 +430,7 @@ ffi_closure_raw_SYSV: #endif #endif /* ifndef __x86_64__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libffi/src/x86/unix64.S b/libffi/src/x86/unix64.S index 831e1d7132f..a33888180bd 100644 --- a/libffi/src/x86/unix64.S +++ b/libffi/src/x86/unix64.S @@ -410,3 +410,7 @@ ffi_closure_unix64: .LEFDE3: #endif /* __x86_64__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c6b52a80986..85efeab7498 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,78 @@ +2008-03-25 Benjamin Kosnik <bkoz@redhat.com> + + * scripts/run_doxygen: Remove html_output_dir. Downgrade to + Doxygen 1.5.1. + * doc/doxygen/style.css: Delete. + * doc/doxygen/user.cfg.in: Regenerate with Doxygen 1.5.1. + (INPUT): Update. + (PREDEFINED): Update. + (HTML_OUTPUT): Remove html_output_dir, use html. + (HTML_STYLESHEET): Remove style.css. + * doc/doxygen/tables.html: Remove style.css use. + * doc/doxygen/mainpage.html: Nested lists for Namespaces and Classes. + * doc/doxygen/doxygroups.cc: Namespace edits. + * doc/doxygen/Intro.3: Correct typo. + + * doc/xml/api.xml: Add gcc-4.3 links. + * doc/html/api.html: Regenerate. + + * include/debug/debug.h: Document namepaces here. + * include/parallel/base.h: Same. + * include/ext/typelist.h: Same. + * include/ext/pb_ds/tag_and_trait.hpp: Same. + + * include/tr1_impl/random: Adjust line break. + * include/tr1_impl/unordered_map: Correct and or add markup. + * include/tr1_impl/boost_shared_ptr.h: Correct and or add markup. + * include/tr1_impl/functional_hash.h: Same. + * include/tr1_impl/cmath: Same. + * include/tr1_impl/functional: Same. + * include/tr1_impl/unordered_set: Same. + * include/tr1_impl/complex: Same. + * include/tr1_impl/type_traits: Same. + * include/tr1_impl/regex: Same. + * include/tr1_impl/array: Same. + * include/std/tuple: Same. + * include/std/date_time: Same. + * include/std/system_error: Same. + * include/std/type_traits: Same. + * include/ext/enc_filebuf.h: Same. + * include/ext/throw_allocator.h: Same. + * include/ext/pool_allocator.h: Same. + * include/ext/bitmap_allocator.h: Same. + * include/ext/concurrence.h: Same. + * include/ext/codecvt_specializations.h: Same. + * include/ext/stdio_sync_filebuf.h: Same. + * include/ext/array_allocator.h: Same. + * include/ext/mt_allocator.h: Same. + * include/bits/locale_classes.h: Same. + * include/bits/locale_facets.h: Same. + * include/bits/codecvt.h: Same. + * include/bits/char_traits.h: Same. + * include/bits/allocator.h: Same. + * include/bits/locale_facets_nonio.h: Same. + * include/tr1/poly_laguerre.tcc: Same. + * include/tr1/riemann_zeta.tcc: Same. + * include/tr1/beta_function.tcc: Same. + * include/tr1/tuple: Same. + * include/tr1/exp_integral.tcc: Same. + * include/tr1/gamma.tcc: Same. + * include/tr1/hypergeometric.tcc: Same. + * include/tr1/modified_bessel_func.tcc: Same. + * include/tr1/legendre_function.tcc: Same. + * include/tr1/type_traits: Same. + * include/tr1/special_function_util.h: Same. + * include/tr1/bessel_function.tcc: Same. + * include/tr1/cmath: Same. + * include/tr1/poly_hermite.tcc: Same. + * include/tr1/ell_integral.tcc: Same. + * config/abi/compatibility.h: Adjust file name. + + * testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust + line numbers. + * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. + * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. + 2008-03-23 Paolo Carlini <pcarlini@suse.de> * doc/xml/faq.xml: Fix various links. diff --git a/libstdc++-v3/config/abi/compatibility.h b/libstdc++-v3/config/abi/compatibility.h index 7b52850f579..9975074dc04 100644 --- a/libstdc++-v3/config/abi/compatibility.h +++ b/libstdc++-v3/config/abi/compatibility.h @@ -28,7 +28,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file compatibility.h +/** @file bits/compatibility.h * This is an internal header file, included by other library sources. * You should not attempt to use it directly. */ diff --git a/libstdc++-v3/doc/doxygen/Intro.3 b/libstdc++-v3/doc/doxygen/Intro.3 index cb3ff2e4a1e..35fdb1384ef 100644 --- a/libstdc++-v3/doc/doxygen/Intro.3 +++ b/libstdc++-v3/doc/doxygen/Intro.3 @@ -1,5 +1,5 @@ .\" t -.\" This man page is released under the FDL as part of libstdc++. +.\" This man page is released under the GPL as part of libstdc++. .TH C++Intro 3 "20 May 2004" "GNU libstdc++" "Standard C++ Library" .SH NAME C++Intro \- Introduction to the GNU libstdc++ man pages diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc index 68d142fdbfb..f051a7e7b55 100644 --- a/libstdc++-v3/doc/doxygen/doxygroups.cc +++ b/libstdc++-v3/doc/doxygen/doxygroups.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2005, 2008 Free Software Foundation, Inc. See license.html for license. This just provides documentation for stuff that doesn't need to be in the @@ -17,36 +17,34 @@ // // // // // // // // // // // // // // // // // // // // // // // // /** @namespace std - * @brief Everything defined by the ISO C++ Standard is within - * namespace <a class="el" href="namespacestd.html">std</a>. + * @brief ISO C++ entities toplevel namespace is std. */ /** @namespace std::__detail - * @brief Implementation details not part of the namespace <a class="el" - * href="namespacestd.html">std</a> interface. + * @brief Implementation details not part of the namespace std interface. */ /** @namespace std::tr1 - * @brief Everything defined by the ISO C++ TR1 is within namespace std::tr1. + * @brief ISO C++ TR1 entities toplevel namespace is std::tr1. */ /** @namespace std::tr1::__detail * @brief Implementation details not part of the namespace std::tr1 interface. */ +/** @namespace std::regex_constants + * @brief ISO C++ 0x entities sub namespace for regex. +*/ +/** @namespace std::placeholders + * @brief ISO C++ 0x entities sub namespace for functional. +*/ /** @namespace __gnu_cxx * @brief GNU extensions for public use. */ /** @namespace __gnu_cxx::__detail - * @brief Implementation details not part of the namespace __gnu_cxx + * @brief Implementation details not part of the namespace __gnu_cxx * interface. */ -/** @namespace __gnu_cxx::typelist - * @brief GNU typelist extensions for public compile-time use. -*/ /** @namespace __gnu_internal * @brief GNU implemenation details, not for public use or * export. Used only when anonymous namespaces cannot be substituted. */ -/** @namespace __gnu_debug - * @brief GNU debug classes for public use. -*/ // // // // // // // // // // // // // // // // // // // // // // // // /** @addtogroup SGIextensions STL extensions from SGI Because libstdc++ based its implementation of the STL subsections of diff --git a/libstdc++-v3/doc/doxygen/mainpage.html b/libstdc++-v3/doc/doxygen/mainpage.html index b723695e7a4..aa650bafeda 100644 --- a/libstdc++-v3/doc/doxygen/mainpage.html +++ b/libstdc++-v3/doc/doxygen/mainpage.html @@ -2,7 +2,6 @@ <html> <head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>libstdc++ Source: Main Index</title> -<link href="style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> @@ -39,14 +38,25 @@ <p>Here are entry points to all the pages generated by Doxygen: <ul> - <li><a href="modules.html">Modules</a> - <li><a href="namespaces.html">Namespace List</a> - <li><a href="hierarchy.html">Class List</a> - <li><a href="annotated.html">Class Annotated List</a> - <li><a href="classes.html">Class Alphabetical Index</a> - <li><a href="globals_func.html">Function Alphabetical List</a> - <li><a href="files.html">Source File List</a> - <li><a href="todo.html">TODO List</a> (This is incomplete... how ironic.) + <li><a href="modules.html">Modules</a></li> + + <li>Namespaces + <ul> + <li><a href="namespaces.html">List</a></li> + <li><a href="namespacemembers.html">Members</a></li> + </ul> + </li> + + <li>Classes + <ul> + <li><a href="classes.html">List</a></li> + <li><a href="hierarchy.html">Hierarchy</a></li> + <li><a href="functions.html">Members</a></li> + </ul> + </li> + + <li><a href="files.html">Source Files</a></li> + <li><a href="todo.html">TODO List</a></li> </ul> </p> diff --git a/libstdc++-v3/doc/doxygen/style.css b/libstdc++-v3/doc/doxygen/style.css deleted file mode 100644 index c49c37cdfd9..00000000000 --- a/libstdc++-v3/doc/doxygen/style.css +++ /dev/null @@ -1,74 +0,0 @@ -BODY { - background: white; - font-size: small; -} -H1 { text-align: center; font-size: large } -H2 { text-align: left; font-size: medium; } -H3 { text-align: left; font-size: small; } -CODE { font-size: small; } -CAPTION { font-weight: normal } -A.qindex {} -A.qindexRef {} -A.el { text-decoration: none; font-size: small; font-weight: normal } -A.elRef { text-decoration: none; font-size: small; font-weight: normal } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #eeeeee } -DIV.ah { - background-color: black; - font-weight: normal; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px -} -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: normal -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: small } -TD.md { background-color: #f2f2ff; font-size: small; } -TD.mdname1 { background-color: #f2f2ff; font-size: small; color: #602020; } -TD.mdname { - background-color: #f2f2ff; - font-weight: normal; - font-size: small; - color: #602020; - width: 600px -} -TD.indexkey { - background-color: #eeeeff; - font-weight: normal; - font-size: small; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - font-size: small; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -span.keyword { color: #008000 } -span.keywordtype { color: #604020 } -span.keywordflow { color: #e08000 } -span.comment { color: #800000 } -span.preprocessor { color: #806020 } -span.stringliteral { color: #002080 } -span.charliteral { color: #008080 } diff --git a/libstdc++-v3/doc/doxygen/tables.html b/libstdc++-v3/doc/doxygen/tables.html index 74ac3e2165d..def011e7408 100644 --- a/libstdc++-v3/doc/doxygen/tables.html +++ b/libstdc++-v3/doc/doxygen/tables.html @@ -2,7 +2,6 @@ <html> <head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Tables</title> -<link href="style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 8895eabe358..059d95da229 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -1,4 +1,4 @@ -# Doxyfile 1.5.4 +# Doxyfile 1.5.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,15 +14,6 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the -# config file that follow. The default is UTF-8 which is also the -# encoding used for all text before the first occurrence of this -# tag. Doxygen uses libiconv (or the iconv built into libc) for the -# transcoding. See http://www.gnu.org/software/libiconv for the list -# of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. @@ -62,6 +53,16 @@ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). @@ -69,11 +70,10 @@ OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = NO -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will -# prepend the brief description of a member or function before the -# detailed description. Note: if both HIDE_UNDOC_MEMBERS and -# BRIEF_MEMBER_DESC are set to NO, the brief descriptions will be -# completely suppressed. +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. REPEAT_BRIEF = YES @@ -135,19 +135,11 @@ SHORT_NAMES = YES # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. @@ -213,18 +205,6 @@ OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip -# sources only. Doxygen will parse them like normal C++ but will -# assume all classes use public instead of private inheritance when no -# explicit protection keyword is present. - -SIP_SUPPORT = NO - # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default @@ -240,16 +220,6 @@ DISTRIBUTE_GROUP_DOC = YES SUBGROUPING = YES -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is -# documented as struct with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code where the coding convention is that all structs are -# typedef'ed and only the typedef is referenced never the struct's name. - -TYPEDEF_HIDES_STRUCT = NO - #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -284,14 +254,6 @@ EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = YES -# If this flag is set to YES, the members of anonymous namespaces will -# be extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the -# base name of the file that contains the anonymous namespace. By -# default anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the @@ -422,20 +384,19 @@ MAX_INITIALIZER_LINES = 0 SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple -# directories then setting the SHOW_DIRECTORIES tag to YES will show -# the directory hierarchy in the documentation. The default is NO. +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. SHOW_DIRECTORIES = YES -# The FILE_VERSION_FILTER tag can be used to specify a program or -# script that doxygen should invoke to get the current version for -# each file (typically from the version control system). Doxygen will -# invoke the program by executing (via popen()) the command <command> -# <input-file>, where <command> is the value of the -# FILE_VERSION_FILTER tag, and <input-file> is the name of an input -# file provided by doxygen. Whatever the program writes to standard -# output is used as the file version. See the manual for examples. +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. FILE_VERSION_FILTER = @@ -494,53 +455,20 @@ WARN_LOGFILE = # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories -# that contain documented source files. You may enter file names like -# "myfile.cpp" or directories like "/usr/src/myproject". Separate the -# files or directories with spaces. +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. -INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ - @srcdir@/include/precompiled/stdc++.h \ - @srcdir@/include/precompiled/stdtr1c++.h \ - @srcdir@/include/precompiled/extc++.h \ - @srcdir@/libsupc++/cxxabi.h \ +INPUT = @srcdir@/libsupc++/cxxabi.h \ + @srcdir@/libsupc++/cxxabi-forced.h \ @srcdir@/libsupc++/exception \ @srcdir@/libsupc++/new \ @srcdir@/libsupc++/typeinfo \ - include/@host_alias@/bits \ - include/bits \ - include/debug \ - include/parallel \ - include/ext \ - include/tr1 \ - include/tr1_impl \ include/algorithm \ include/array \ include/bitset \ - include/cassert \ - include/ccomplex \ - include/cctype \ - include/cerrno \ - include/cfenv \ - include/cfloat \ - include/cinttypes \ - include/ciso646 \ - include/climits \ - include/clocale \ - include/cmath \ - include/csetjmp \ - include/csignal \ - include/cstdarg \ - include/cstdbool \ - include/cstddef \ - include/cstdint \ - include/cstdio \ - include/cstdlib \ - include/cstring \ - include/ctgmath \ - include/ctime \ - include/cwchar \ - include/cwctype \ + include/date_time \ include/deque \ include/fstream \ include/functional \ @@ -574,14 +502,41 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/utility \ include/valarray \ include/vector \ + include/cassert \ + include/ccomplex \ + include/cctype \ + include/cerrno \ + include/cfenv \ + include/cfloat \ + include/cinttypes \ + include/ciso646 \ + include/climits \ + include/clocale \ + include/cmath \ + include/csetjmp \ + include/csignal \ + include/cstdarg \ + include/cstdbool \ + include/cstddef \ + include/cstdint \ + include/cstdio \ + include/cstdlib \ + include/cstring \ + include/ctgmath \ + include/ctime \ + include/cwchar \ + include/cwctype \ include/backward/hash_map \ include/backward/hash_set \ + include/backward/strstream \ include/debug/bitset \ include/debug/deque \ include/debug/list \ include/debug/map \ include/debug/set \ include/debug/string \ + include/debug/unordered_map \ + include/debug/unordered_set \ include/debug/vector \ include/ext/algorithm \ include/ext/functional \ @@ -591,8 +546,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/ext/rb_tree \ include/ext/rope \ include/ext/slist \ - include/ext/pb_ds \ - include/ext/pb_ds/detail \ include/parallel/algorithm \ include/parallel/numeric \ include/tr1/array \ @@ -614,7 +567,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/tr1/cwchar \ include/tr1/cwctype \ include/tr1/functional \ - include/tr1/hashtable.h \ include/tr1/memory \ include/tr1/random \ include/tr1/regex \ @@ -622,7 +574,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/tr1/type_traits \ include/tr1/unordered_map \ include/tr1/unordered_set \ - include/tr1_impl/utility \ include/tr1_impl/array \ include/tr1_impl/cctype \ include/tr1_impl/cfenv \ @@ -638,27 +589,28 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/tr1_impl/hashtable \ include/tr1_impl/random \ include/tr1_impl/regex \ - include/tr1_impl/tuple \ include/tr1_impl/type_traits \ include/tr1_impl/unordered_map \ include/tr1_impl/unordered_set \ - include/tr1_impl/utility - -# This tag can be used to specify the character encoding of the source -# files that doxygen parses. Internally doxygen uses the UTF-8 -# encoding, which is also the default input encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible -# encodings. - -INPUT_ENCODING = UTF-8 + include/tr1_impl/utility \ + include/@host_alias@/bits \ + include/backward \ + include/bits \ + include/debug \ + include/parallel \ + include/tr1 \ + include/tr1_impl \ + include/ext \ + include/ext/pb_ds \ + include/ext/pb_ds/detail \ + @srcdir@/doc/doxygen/doxygroups.cc # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = *.h \ *.hpp \ @@ -694,14 +646,6 @@ EXCLUDE_PATTERNS = stamp-* \ *extc++.h* \ */.svn/* -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol -# names (namespaces, classes, functions, etc.) that should be excluded -# from the output. The symbol name can be a fully qualified name, a -# word, or if the wildcard * is used, a substring. Examples: -# ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). @@ -757,13 +701,10 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files -# will be generated. Documented entities will be cross-referenced with -# these sources. Note: To get rid of all source code in the generated -# output, make sure also VERBATIM_HEADERS is set to NO. If you have -# enabled CALL_GRAPH or CALLER_GRAPH then you must also enable this -# option. If you don't then doxygen will produce a warning and turn it -# on anyway +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES @@ -847,7 +788,7 @@ GENERATE_HTML = @do_html@ # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. -HTML_OUTPUT = @html_output_dir@ +HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank @@ -874,7 +815,7 @@ HTML_FOOTER = # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = @srcdir@/doc/doxygen/style.css +HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to @@ -889,14 +830,6 @@ HTML_ALIGN_MEMBERS = NO GENERATE_HTMLHELP = NO -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be @@ -1120,7 +1053,6 @@ XML_OUTPUT = xml # which can be used by a validating XML parser to check the # syntax of the XML files. -#XML_SCHEMA = XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, @@ -1128,7 +1060,6 @@ XML_SCHEMA = # syntax of the XML files. XML_DTD = -#XML_DTD = http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting @@ -1232,13 +1163,18 @@ INCLUDE_FILE_PATTERNS = # instead of the = operator. PREDEFINED = __GTHREADS \ + "_GLIBCXX_STD_P= " \ + "_GLIBCXX_STD_D= " \ _GLIBCXX_STD=std \ - _GLIBCXX_TR1=tr1 \ + "_GLIBCXX_TR1= " \ + "_GLIBCXX_BEGIN_NAMESPACE_TR1= " \ + "_GLIBCXX_END_NAMESPACE_TR1= " \ "_GLIBCXX_BEGIN_NAMESPACE(name)=namespace name { " \ "_GLIBCXX_BEGIN_NESTED_NAMESPACE(name, unused)=namespace name { " \ _GLIBCXX_END_NAMESPACE=} \ _GLIBCXX_END_NESTED_NAMESPACE=} \ "_GLIBCXX_TEMPLATE_ARGS=... " \ + _GLIBCXX_INCLUDE_AS_CXX0X \ _GLIBCXX_DEPRECATED \ _GLIBCXX_USE_WCHAR_T \ _GLIBCXX_USE_LONG_LONG \ @@ -1248,11 +1184,10 @@ PREDEFINED = __GTHREADS \ __glibcxx_class_requires3=// \ __glibcxx_class_requires4=// -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES -# then this tag can be used to specify a list of macro names that -# should be expanded. The macro definition that is found in the -# sources will be used. Use the PREDEFINED tag if you want to use a -# different macro definition. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = @@ -1320,14 +1255,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. - -MSCGEN_PATH = - # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. @@ -1385,21 +1312,19 @@ INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO -# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES -# then doxygen will generate a call dependency graph for every global -# function or class method. Note that enabling this option will -# significantly increase the time of a run. So in most cases it will -# be better to enable call graphs for selected functions only using -# the \callgraph command. +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. CALL_GRAPH = NO -# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES -# then doxygen will generate a caller dependency graph for every -# global function or class method. Note that enabling this option -# will significantly increase the time of a run. So in most cases it -# will be better to enable caller graphs for selected functions only -# using the \callergraph command. +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. CALLER_GRAPH = NO @@ -1432,24 +1357,31 @@ DOT_PATH = DOTFILE_DIRS = -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum -# number of nodes that will be shown in the graph. If the number of -# nodes in a graph becomes larger than this value, doxygen will -# truncate the graph, which is visualized by representing a node as a -# red box. Note that doxygen if the number of direct children of the -# root node in a graph is already larger than MAX_DOT_GRAPH_NOTES then -# the graph will not be shown at all. Also note that the size of a -# graph can be further restricted by MAX_DOT_GRAPH_DEPTH. +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. -DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. +# code bases. Also note that a graph may be further truncated if the graph's +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), +# the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html index dd895fc5506..6724b72ade2 100644 --- a/libstdc++-v3/doc/html/api.html +++ b/libstdc++-v3/doc/html/api.html @@ -5,7 +5,7 @@ <a class="ulink" href="http://www.fsf.org/" target="_top">FSF </a> - </p></div><div><div class="legalnotice"><a id="id375791"></a><p> + </p></div><div><div class="legalnotice"><a id="id478877"></a><p> <a class="ulink" href="17_intro/license.html" target="_top">License </a> </p></div></div></div><hr /></div><p> @@ -29,6 +29,9 @@ viewed online: <a class="ulink" href="libstdc++-html-USERS-4.2/index.html" target="_top">for the 4.2 release </a> </p></li><li><p> + <a class="ulink" href="libstdc++-html-USERS-4.3/index.html" target="_top">for the 4.3 release + </a> + </p></li><li><p> <a class="ulink" href="latest-doxygen/index.html" target="_top">"the latest collection" </a> (For the main development tree; see the date on the first page.) diff --git a/libstdc++-v3/doc/xml/api.xml b/libstdc++-v3/doc/xml/api.xml index 506f631ba0a..f7ecb7d1acc 100644 --- a/libstdc++-v3/doc/xml/api.xml +++ b/libstdc++-v3/doc/xml/api.xml @@ -63,6 +63,12 @@ viewed online: </listitem> <listitem> <para> + <ulink url="libstdc++-html-USERS-4.3/index.html">for the 4.3 release + </ulink> + </para> + </listitem> + <listitem> + <para> <ulink url="latest-doxygen/index.html">"the latest collection" </ulink> (For the main development tree; see the date on the first page.) diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index 8a0d0eec887..a90f7b4105b 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -1,6 +1,6 @@ // Allocators -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @brief The "standard" allocator, as per [20.4]. * * Further details: - * http://gcc.gnu.org/onlinedocs/libstdc++/20_util/allocator.html + * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html */ template<typename _Tp> class allocator: public __glibcxx_base_allocator<_Tp> diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index d01db93be49..ae0f6cfbe09 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -231,7 +231,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { }; - /// @brief 21.1.3.1 char_traits specializations + /// 21.1.3.1 char_traits specializations template<> struct char_traits<char> { @@ -301,7 +301,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) #ifdef _GLIBCXX_USE_WCHAR_T - /// @brief 21.1.3.2 char_traits specializations + /// 21.1.3.2 char_traits specializations template<> struct char_traits<wchar_t> { diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 8d182499d6d..9d6655a0aad 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -1,6 +1,6 @@ // Locale support (codecvt) -*- C++ -*- -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - /// @brief Empty base class for codecvt facet [22.2.1.5]. + /// Empty base class for codecvt facet [22.2.1.5]. class codecvt_base { public: @@ -330,7 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template<typename _InternT, typename _ExternT, typename _StateT> locale::id codecvt<_InternT, _ExternT, _StateT>::id; - /// @brief class codecvt<char, char, mbstate_t> specialization. + /// class codecvt<char, char, mbstate_t> specialization. template<> class codecvt<char, char, mbstate_t> : public __codecvt_abstract_base<char, char, mbstate_t> @@ -388,7 +388,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; #ifdef _GLIBCXX_USE_WCHAR_T - /// @brief class codecvt<wchar_t, char, mbstate_t> specialization. + /// class codecvt<wchar_t, char, mbstate_t> specialization. template<> class codecvt<wchar_t, char, mbstate_t> : public __codecvt_abstract_base<wchar_t, char, mbstate_t> @@ -448,7 +448,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; #endif //_GLIBCXX_USE_WCHAR_T - /// @brief class codecvt_byname [22.2.1.6]. + /// class codecvt_byname [22.2.1.6]. template<typename _InternT, typename _ExternT, typename _StateT> class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h index 10ca19af97d..cab5812160e 100644 --- a/libstdc++-v3/include/bits/locale_classes.h +++ b/libstdc++-v3/include/bits/locale_classes.h @@ -780,7 +780,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const; #endif - /// @brief class collate_byname [22.2.4.2]. + /// class collate_byname [22.2.4.2]. template<typename _CharT> class collate_byname : public collate<_CharT> { diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index c60f04d262a..cb9c021f353 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -1511,7 +1511,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) use_facet<ctype<wchar_t> >(const locale& __loc); #endif //_GLIBCXX_USE_WCHAR_T - /// @brief class ctype_byname [22.2.1.2]. + /// class ctype_byname [22.2.1.2]. template<typename _CharT> class ctype_byname : public ctype<_CharT> { @@ -1912,7 +1912,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc); #endif - /// @brief class numpunct_byname [22.2.3.2]. + /// class numpunct_byname [22.2.3.2]. template<typename _CharT> class numpunct_byname : public numpunct<_CharT> { diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.h b/libstdc++-v3/include/bits/locale_facets_nonio.h index 31c90e3b43c..f2da433fc67 100644 --- a/libstdc++-v3/include/bits/locale_facets_nonio.h +++ b/libstdc++-v3/include/bits/locale_facets_nonio.h @@ -674,7 +674,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template<typename _CharT, typename _InIter> locale::id time_get<_CharT, _InIter>::id; - /// @brief class time_get_byname [22.2.5.2]. + /// class time_get_byname [22.2.5.2]. template<typename _CharT, typename _InIter> class time_get_byname : public time_get<_CharT, _InIter> { @@ -798,7 +798,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template<typename _CharT, typename _OutIter> locale::id time_put<_CharT, _OutIter>::id; - /// @brief class time_put_byname [22.2.5.4]. + /// class time_put_byname [22.2.5.4]. template<typename _CharT, typename _OutIter> class time_put_byname : public time_put<_CharT, _OutIter> { @@ -1306,7 +1306,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const char*); #endif - /// @brief class moneypunct_byname [22.2.6.4]. + /// class moneypunct_byname [22.2.6.4]. template<typename _CharT, bool _Intl> class moneypunct_byname : public moneypunct<_CharT, _Intl> { @@ -1887,7 +1887,7 @@ _GLIBCXX_END_LDBL_NAMESPACE messages<wchar_t>::do_get(catalog, int, int, const wstring&) const; #endif - /// @brief class messages_byname [22.2.7.2]. + /// class messages_byname [22.2.7.2]. template<typename _CharT> class messages_byname : public messages<_CharT> { diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h index 97d6824ef0c..0f64488c234 100644 --- a/libstdc++-v3/include/debug/debug.h +++ b/libstdc++-v3/include/debug/debug.h @@ -44,11 +44,19 @@ */ // Debug mode namespaces. + +/** + * @namespace std::__debug + * @brief GNU debug code, replaces standard behavior with debug behavior. + */ namespace std { namespace __debug { } } +/** @namespace __gnu_debug + * @brief GNU debug classes for public use. +*/ namespace __gnu_debug { using namespace std::__debug; diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h index d5f70923743..a2e28f9d998 100644 --- a/libstdc++-v3/include/ext/array_allocator.h +++ b/libstdc++-v3/include/ext/array_allocator.h @@ -45,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) using std::size_t; using std::ptrdiff_t; - /// @brief Base class. + /// Base class. template<typename _Tp> class array_allocator_base { diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h index 2736a4640eb..5e553b00af8 100644 --- a/libstdc++-v3/include/ext/bitmap_allocator.h +++ b/libstdc++-v3/include/ext/bitmap_allocator.h @@ -706,6 +706,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) }; }; + /// Primary template template<typename _Tp> class bitmap_allocator : private free_list { diff --git a/libstdc++-v3/include/ext/codecvt_specializations.h b/libstdc++-v3/include/ext/codecvt_specializations.h index 42e3c0f1477..e46d9675fd1 100644 --- a/libstdc++-v3/include/ext/codecvt_specializations.h +++ b/libstdc++-v3/include/ext/codecvt_specializations.h @@ -47,7 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - /// @brief Extension to use iconv for dealing with character encodings. + /// Extension to use iconv for dealing with character encodings. // This includes conversions and comparisons between various character // sets. This object encapsulates data that may need to be shared between // char_traits, codecvt and ctype. @@ -206,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) } }; - /// @brief encoding_char_traits. + /// encoding_char_traits // Custom traits type with encoding_state for the state type, and the // associated fpos<encoding_state> for the position type, all other // bits equivalent to the required char_traits instantiations. @@ -224,7 +224,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) using __gnu_cxx::encoding_state; - /// @brief codecvt<InternT, _ExternT, encoding_state> specialization. + /// codecvt<InternT, _ExternT, encoding_state> specialization. // This partial specialization takes advantage of iconv to provide // code conversions between a large number of character encodings. template<typename _InternT, typename _ExternT> diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h index 765b93dbdc2..b9e43d67f90 100644 --- a/libstdc++-v3/include/ext/concurrence.h +++ b/libstdc++-v3/include/ext/concurrence.h @@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { return &_M_mutex; } }; - /// @brief Scoped lock idiom. + /// Scoped lock idiom. // Acquire the mutex here with a constructor call, then release with // the destructor call in accordance with RAII style. class __scoped_lock diff --git a/libstdc++-v3/include/ext/enc_filebuf.h b/libstdc++-v3/include/ext/enc_filebuf.h index bba78e06be4..e04072bce47 100644 --- a/libstdc++-v3/include/ext/enc_filebuf.h +++ b/libstdc++-v3/include/ext/enc_filebuf.h @@ -40,7 +40,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - /// @brief class enc_filebuf. + /// class enc_filebuf. template<typename _CharT> class enc_filebuf : public std::basic_filebuf<_CharT, encoding_char_traits<_CharT> > diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h index 84aed823a68..08aa311f8b8 100644 --- a/libstdc++-v3/include/ext/mt_allocator.h +++ b/libstdc++-v3/include/ext/mt_allocator.h @@ -47,7 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) typedef void (*__destroy_handler)(void*); - /// @brief Base class for pool object. + /// Base class for pool object. struct __pool_base { // Using short int as type for the binmap implies we are never @@ -455,7 +455,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) }; #endif - /// @brief Policy for shared __pool objects. + /// Policy for shared __pool objects. template<template <bool> class _PoolTp, bool _Thread> struct __common_pool_policy : public __common_pool_base<_PoolTp, _Thread> { @@ -550,7 +550,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) }; #endif - /// @brief Policy for individual __pool objects. + /// Policy for individual __pool objects. template<typename _Tp, template <bool> class _PoolTp, bool _Thread> struct __per_type_pool_policy : public __per_type_pool_base<_Tp, _PoolTp, _Thread> @@ -565,7 +565,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) }; - /// @brief Base class for _Tp dependent member functions. + /// Base class for _Tp dependent member functions. template<typename _Tp> class __mt_alloc_base { @@ -621,7 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) * the "global" list). * * Further details: - * http://gcc.gnu.org/onlinedocs/libstdc++/ext/mt_allocator.html + * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch32.html */ template<typename _Tp, typename _Poolp = __common_pool_policy<__pool, __thread_default> > diff --git a/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp b/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp index 09475a2ec95..bb39d17931f 100644 --- a/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp +++ b/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp @@ -52,9 +52,8 @@ /** * @namespace __gnu_pbds - * @brief GNU extension policy-based data structures for public use. + * @brief GNU extensions for policy-based data structures for public use. */ - namespace __gnu_pbds { // A trivial iterator tag. Signifies that the iterators has none of diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h index e2e38a02af5..c4d2ef2157d 100644 --- a/libstdc++-v3/include/ext/pool_allocator.h +++ b/libstdc++-v3/include/ext/pool_allocator.h @@ -119,7 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) }; - /// @brief class __pool_alloc. + /// class __pool_alloc. template<typename _Tp> class __pool_alloc : private __pool_alloc_base { diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h index a1d2b385daa..6cb555a08a3 100644 --- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h +++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h @@ -47,7 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - /// @brief class stdio_sync_filebuf. + /// class stdio_sync_filebuf. template<typename _CharT, typename _Traits = std::char_traits<_CharT> > class stdio_sync_filebuf : public std::basic_streambuf<_CharT, _Traits> { diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 04204cb55fc..a5aa725cdce 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -80,6 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) std::tr1::mt19937 _M_generator; }; + /// Thown by throw_allocator. struct forced_exception_error : public std::exception { }; @@ -94,6 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) #endif } + /// Base class. class throw_allocator_base { public: @@ -184,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) static size_t _S_label; }; - + /// Allocator class with logging and exception control. template<typename T> class throw_allocator : public throw_allocator_base { @@ -309,7 +311,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) twister_rand_gen throw_allocator_base::_S_g; - throw_allocator_base::map_type + throw_allocator_base::map_type throw_allocator_base::_S_map; double throw_allocator_base::_S_throw_prob; diff --git a/libstdc++-v3/include/ext/typelist.h b/libstdc++-v3/include/ext/typelist.h index 1c99783923d..b7cd95434e6 100644 --- a/libstdc++-v3/include/ext/typelist.h +++ b/libstdc++-v3/include/ext/typelist.h @@ -50,6 +50,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +/** @namespace __gnu_cxx::typelist + * @brief GNU typelist extensions for public compile-time use. +*/ namespace typelist { struct null_type { }; diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h index 2060d817e0c..b713ee7a410 100644 --- a/libstdc++-v3/include/parallel/base.h +++ b/libstdc++-v3/include/parallel/base.h @@ -47,6 +47,11 @@ // Parallel mode namespaces. + +/** + * @namespace std::__parallel + * @brief GNU parallel code, replaces standard behavior with parallel behavior. + */ namespace std { namespace __parallel { } @@ -54,7 +59,7 @@ namespace std /** * @namespace __gnu_parallel - * @brief GNU parallel classes for public use. + * @brief GNU parallel code for public use. */ namespace __gnu_parallel { diff --git a/libstdc++-v3/include/std/date_time b/libstdc++-v3/include/std/date_time index 792a1408a6c..b956a9b0119 100644 --- a/libstdc++-v3/include/std/date_time +++ b/libstdc++-v3/include/std/date_time @@ -45,7 +45,8 @@ namespace std { // duration types - + + /// nanoseconds class nanoseconds { public: @@ -90,7 +91,7 @@ namespace std class minutes; class hours; - // timepoint type + /// timepoint type class system_time { public: diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index c2a1d0150c9..c8973d14735 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -53,6 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) extern const error_category& system_category; + /// error_category struct error_category { error_category() { } @@ -78,6 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) operator=(const error_category&); }; + /// error_code struct error_code { error_code() throw() @@ -133,6 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const error_category* _M_cat; }; + /// Thrown to indicate error code of underlying system. class system_error : public std::runtime_error { private: diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 78f69deee13..3dda5301644 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -205,6 +205,7 @@ namespace std } }; + /// tuple template<typename... _Elements> class tuple : public _Tuple_impl<0, _Elements...> { @@ -275,9 +276,11 @@ namespace std } }; - template<> class tuple<> { }; - // 2-element tuple, with construction and assignment from a pair. + template<> + class tuple<> { }; + + /// tuple (2-element), with construction and assignment from a pair. template<typename _T1, typename _T2> class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2> { @@ -393,7 +396,7 @@ namespace std template<typename _Tp> struct tuple_size; - /// @brief class tuple_size + /// class tuple_size template<typename... _Elements> struct tuple_size<tuple<_Elements...> > { diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 38c92abf6e8..1f9a2d9f72d 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -1,6 +1,6 @@ // <type_traits> -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -63,6 +63,8 @@ namespace std { // Primary classification traits. + + /// is_lvalue_reference template<typename> struct is_lvalue_reference : public false_type { }; @@ -71,6 +73,7 @@ namespace std struct is_lvalue_reference<_Tp&> : public true_type { }; + /// is_rvalue_reference template<typename> struct is_rvalue_reference : public false_type { }; @@ -80,6 +83,8 @@ namespace std : public true_type { }; // Secondary classification traits. + + /// is_reference template<typename _Tp> struct is_reference : public integral_constant<bool, (is_lvalue_reference<_Tp>::value @@ -87,6 +92,8 @@ namespace std { }; // Reference transformations. + + /// remove_reference template<typename _Tp> struct remove_reference { typedef _Tp type; }; @@ -113,6 +120,7 @@ namespace std struct __add_lvalue_reference_helper<_Tp, false, true> { typedef typename remove_reference<_Tp>::type& type; }; + /// add_lvalue_reference template<typename _Tp> struct add_lvalue_reference : public __add_lvalue_reference_helper<_Tp> @@ -127,12 +135,14 @@ namespace std struct __add_rvalue_reference_helper<_Tp, true> { typedef _Tp&& type; }; + /// add_rvalue_reference template<typename _Tp> struct add_rvalue_reference : public __add_rvalue_reference_helper<_Tp> { }; // Scalar properties and transformations. + template<typename _Tp, bool = is_integral<_Tp>::value, bool = is_floating_point<_Tp>::value> @@ -148,11 +158,13 @@ namespace std : public integral_constant<bool, _Tp(-1) < _Tp(0)> { }; + /// is_signed template<typename _Tp> struct is_signed : public integral_constant<bool, __is_signed_helper<_Tp>::value> { }; + /// is_unsigned template<typename _Tp> struct is_unsigned : public integral_constant<bool, (is_arithmetic<_Tp>::value @@ -160,46 +172,56 @@ namespace std { }; // Member introspection. + + /// is_pod template<typename _Tp> struct is_pod : public integral_constant<bool, __is_pod(_Tp)> { }; + /// has_trivial_default_constructor template<typename _Tp> struct has_trivial_default_constructor : public integral_constant<bool, __has_trivial_constructor(_Tp)> { }; + /// has_trivial_copy_constructor template<typename _Tp> struct has_trivial_copy_constructor : public integral_constant<bool, __has_trivial_copy(_Tp)> { }; + /// has_trivial_assign template<typename _Tp> struct has_trivial_assign : public integral_constant<bool, __has_trivial_assign(_Tp)> { }; + /// has_trivial_destructor template<typename _Tp> struct has_trivial_destructor : public integral_constant<bool, __has_trivial_destructor(_Tp)> { }; + /// has_nothrow_default_destructor template<typename _Tp> struct has_nothrow_default_constructor : public integral_constant<bool, __has_nothrow_constructor(_Tp)> { }; + /// has_nothrow_copy_destructor template<typename _Tp> struct has_nothrow_copy_constructor : public integral_constant<bool, __has_nothrow_copy(_Tp)> { }; + /// has_nothrow_assign template<typename _Tp> struct has_nothrow_assign : public integral_constant<bool, __has_nothrow_assign(_Tp)> { }; + /// is_base_of template<typename _Base, typename _Derived> struct is_base_of : public integral_constant<bool, __is_base_of(_Base, _Derived)> @@ -232,7 +254,7 @@ namespace std template<typename _From, typename _To, bool = (is_void<_From>::value || is_void<_To>::value || is_function<_To>::value || is_array<_To>::value - // This special case is here only to avoid warnings. + // This special case is here only to avoid warnings. || (is_floating_point<typename remove_reference<_From>::type>::value && __is_int_or_cref<_To>::__value))> @@ -252,6 +274,7 @@ namespace std // XXX FIXME // The C++0x specifications are different, see N2255. + /// is_convertible template<typename _From, typename _To> struct is_convertible : public integral_constant<bool, @@ -268,6 +291,16 @@ namespace std }; }; + /** + * @brief Alignment type. + * + * The value of _Align is a default-alignment which shall be the + * most stringent alignment requirement for any C++ object type + * whose size is no greater than _Len (3.9). The member typedef + * type shall be a POD type suitable for use as uninitialized + * storage for any object whose size is at most _Len and whose + * alignment is a divisor of _Align. + */ template<std::size_t _Len, std::size_t _Align = __alignof__(typename __aligned_storage_msa<_Len>::__type)> struct aligned_storage @@ -281,21 +314,25 @@ namespace std // Define a nested type if some predicate holds. + /// Primary template. template<bool, typename _Tp = void> struct enable_if { }; + /// Partial specialization for true. template<typename _Tp> struct enable_if<true, _Tp> { typedef _Tp type; }; - // Like a conditional expression, but for types. If true, first, if - // false, second. + // A conditional expression, but for types. + // If true, first, if false, second. + /// Primary template. template<bool _Cond, typename _Iftrue, typename _Iffalse> struct conditional { typedef _Iftrue type; }; + /// Partial specialization for false. template<typename _Iftrue, typename _Iffalse> struct conditional<false, _Iftrue, _Iffalse> { typedef _Iffalse type; }; @@ -321,6 +358,7 @@ namespace std struct __decay_selector<_Up, false, true> { typedef typename add_pointer<_Up>::type __type; }; + /// decay template<typename _Tp> struct decay { @@ -428,9 +466,9 @@ namespace std typedef typename conditional<__b1, __smallest, __cond_type>::type __type; }; - // Primary class template. // Given an integral/enum type, return the corresponding unsigned // integer type. + /// Primary template. template<typename _Tp> struct make_unsigned { typedef typename __make_unsigned_selector<_Tp>::__type type; }; @@ -503,9 +541,9 @@ namespace std typedef typename conditional<__b1, __smallest, __cond_type>::type __type; }; - // Primary class template. // Given an integral/enum type, return the corresponding signed // integer type. + /// Primary template. template<typename _Tp> struct make_signed { typedef typename __make_signed_selector<_Tp>::__type type; }; diff --git a/libstdc++-v3/include/tr1/bessel_function.tcc b/libstdc++-v3/include/tr1/bessel_function.tcc index 19c9860d51c..bf61a6fcf74 100644 --- a/libstdc++-v3/include/tr1/bessel_function.tcc +++ b/libstdc++-v3/include/tr1/bessel_function.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -61,14 +61,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -633,9 +626,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/beta_function.tcc b/libstdc++-v3/include/tr1/beta_function.tcc index 537947ed287..8c0b1b53f8e 100644 --- a/libstdc++-v3/include/tr1/beta_function.tcc +++ b/libstdc++-v3/include/tr1/beta_function.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -59,14 +59,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -203,9 +196,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath index 81a3bfefde6..63e6a2e5fda 100644 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -1,6 +1,6 @@ // TR1 cmath -*- C++ -*- -// Copyright (C) 2006, 2007 Free Software Foundation, Inc. +// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -56,15 +56,10 @@ # undef _GLIBCXX_INCLUDE_AS_TR1 #endif -/** - * @defgroup tr1_math_spec_func Mathematical Special Functions - * A collection of advanced mathematical special functions. - * @{ - */ #include <bits/stl_algobase.h> #include <limits> - #include <tr1/type_traits> + #include <tr1/gamma.tcc> #include <tr1/bessel_function.tcc> #include <tr1/beta_function.tcc> @@ -77,12 +72,16 @@ #include <tr1/poly_laguerre.tcc> #include <tr1/riemann_zeta.tcc> -// namespace std::tr1 namespace std { namespace tr1 { - // 5.2.1.1 Associated Laguerre polynomials. + /** + * @addtogroup tr1_math_spec_func Mathematical Special Functions + * A collection of advanced mathematical special functions. + * @{ + */ + inline float assoc_laguerref(unsigned int __n, unsigned int __m, float __x) { return __detail::__assoc_laguerre<float>(__n, __m, __x); } @@ -93,6 +92,7 @@ namespace tr1 return __detail::__assoc_laguerre<long double>(__n, __m, __x); } + /// 5.2.1.1 Associated Laguerre polynomials. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x) @@ -101,7 +101,6 @@ namespace tr1 return __detail::__assoc_laguerre<__type>(__n, __m, __x); } - // 5.2.1.2 Associated Legendre functions. inline float assoc_legendref(unsigned int __l, unsigned int __m, float __x) { return __detail::__assoc_legendre_p<float>(__l, __m, __x); } @@ -110,6 +109,7 @@ namespace tr1 assoc_legendrel(unsigned int __l, unsigned int __m, long double __x) { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); } + /// 5.2.1.2 Associated Legendre functions. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x) @@ -118,7 +118,6 @@ namespace tr1 return __detail::__assoc_legendre_p<__type>(__l, __m, __x); } - // 5.2.1.3 Beta functions. inline float betaf(float __x, float __y) { return __detail::__beta<float>(__x, __y); } @@ -127,6 +126,7 @@ namespace tr1 betal(long double __x, long double __y) { return __detail::__beta<long double>(__x, __y); } + /// 5.2.1.3 Beta functions. template<typename _Tpx, typename _Tpy> inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type beta(_Tpx __x, _Tpy __y) @@ -135,7 +135,6 @@ namespace tr1 return __detail::__beta<__type>(__x, __y); } - // 5.2.1.4 Complete elliptic integrals of the first kind. inline float comp_ellint_1f(float __k) { return __detail::__comp_ellint_1<float>(__k); } @@ -144,6 +143,7 @@ namespace tr1 comp_ellint_1l(long double __k) { return __detail::__comp_ellint_1<long double>(__k); } + /// 5.2.1.4 Complete elliptic integrals of the first kind. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type comp_ellint_1(_Tp __k) @@ -152,7 +152,6 @@ namespace tr1 return __detail::__comp_ellint_1<__type>(__k); } - // 5.2.1.5 Complete elliptic integrals of the second kind. inline float comp_ellint_2f(float __k) { return __detail::__comp_ellint_2<float>(__k); } @@ -161,6 +160,7 @@ namespace tr1 comp_ellint_2l(long double __k) { return __detail::__comp_ellint_2<long double>(__k); } + /// 5.2.1.5 Complete elliptic integrals of the second kind. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type comp_ellint_2(_Tp __k) @@ -169,7 +169,6 @@ namespace tr1 return __detail::__comp_ellint_2<__type>(__k); } - // 5.2.1.6 Complete elliptic integrals of the third kind. inline float comp_ellint_3f(float __k, float __nu) { return __detail::__comp_ellint_3<float>(__k, __nu); } @@ -178,6 +177,7 @@ namespace tr1 comp_ellint_3l(long double __k, long double __nu) { return __detail::__comp_ellint_3<long double>(__k, __nu); } + /// 5.2.1.6 Complete elliptic integrals of the third kind. template<typename _Tp, typename _Tpn> inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type comp_ellint_3(_Tp __k, _Tpn __nu) @@ -186,7 +186,6 @@ namespace tr1 return __detail::__comp_ellint_3<__type>(__k, __nu); } - // 5.2.1.7 Confluent hypergeometric functions. inline float conf_hypergf(float __a, float __c, float __x) { return __detail::__conf_hyperg<float>(__a, __c, __x); } @@ -195,6 +194,7 @@ namespace tr1 conf_hypergl(long double __a, long double __c, long double __x) { return __detail::__conf_hyperg<long double>(__a, __c, __x); } + /// 5.2.1.7 Confluent hypergeometric functions. template<typename _Tpa, typename _Tpc, typename _Tp> inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x) @@ -203,7 +203,6 @@ namespace tr1 return __detail::__conf_hyperg<__type>(__a, __c, __x); } - // 5.2.1.8 Regular modified cylindrical Bessel functions. inline float cyl_bessel_if(float __nu, float __x) { return __detail::__cyl_bessel_i<float>(__nu, __x); } @@ -212,6 +211,7 @@ namespace tr1 cyl_bessel_il(long double __nu, long double __x) { return __detail::__cyl_bessel_i<long double>(__nu, __x); } + /// 5.2.1.8 Regular modified cylindrical Bessel functions. template<typename _Tpnu, typename _Tp> inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type cyl_bessel_i(_Tpnu __nu, _Tp __x) @@ -220,7 +220,6 @@ namespace tr1 return __detail::__cyl_bessel_i<__type>(__nu, __x); } - // 5.2.1.9 Cylindrical Bessel functions (of the first kind). inline float cyl_bessel_jf(float __nu, float __x) { return __detail::__cyl_bessel_j<float>(__nu, __x); } @@ -229,6 +228,7 @@ namespace tr1 cyl_bessel_jl(long double __nu, long double __x) { return __detail::__cyl_bessel_j<long double>(__nu, __x); } + /// 5.2.1.9 Cylindrical Bessel functions (of the first kind). template<typename _Tpnu, typename _Tp> inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type cyl_bessel_j(_Tpnu __nu, _Tp __x) @@ -237,7 +237,6 @@ namespace tr1 return __detail::__cyl_bessel_j<__type>(__nu, __x); } - // 5.2.1.10 Irregular modified cylindrical Bessel functions. inline float cyl_bessel_kf(float __nu, float __x) { return __detail::__cyl_bessel_k<float>(__nu, __x); } @@ -246,6 +245,7 @@ namespace tr1 cyl_bessel_kl(long double __nu, long double __x) { return __detail::__cyl_bessel_k<long double>(__nu, __x); } + /// 5.2.1.10 Irregular modified cylindrical Bessel functions. template<typename _Tpnu, typename _Tp> inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type cyl_bessel_k(_Tpnu __nu, _Tp __x) @@ -254,7 +254,6 @@ namespace tr1 return __detail::__cyl_bessel_k<__type>(__nu, __x); } - // 5.2.1.11 Cylindrical Neumann functions. inline float cyl_neumannf(float __nu, float __x) { return __detail::__cyl_neumann_n<float>(__nu, __x); } @@ -263,6 +262,7 @@ namespace tr1 cyl_neumannl(long double __nu, long double __x) { return __detail::__cyl_neumann_n<long double>(__nu, __x); } + /// 5.2.1.11 Cylindrical Neumann functions. template<typename _Tpnu, typename _Tp> inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type cyl_neumann(_Tpnu __nu, _Tp __x) @@ -271,7 +271,6 @@ namespace tr1 return __detail::__cyl_neumann_n<__type>(__nu, __x); } - // 5.2.1.12 Incomplete elliptic integrals of the first kind. inline float ellint_1f(float __k, float __phi) { return __detail::__ellint_1<float>(__k, __phi); } @@ -280,6 +279,7 @@ namespace tr1 ellint_1l(long double __k, long double __phi) { return __detail::__ellint_1<long double>(__k, __phi); } + /// 5.2.1.12 Incomplete elliptic integrals of the first kind. template<typename _Tp, typename _Tpp> inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type ellint_1(_Tp __k, _Tpp __phi) @@ -288,7 +288,6 @@ namespace tr1 return __detail::__ellint_1<__type>(__k, __phi); } - // 5.2.1.13 Incomplete elliptic integrals of the second kind. inline float ellint_2f(float __k, float __phi) { return __detail::__ellint_2<float>(__k, __phi); } @@ -297,6 +296,7 @@ namespace tr1 ellint_2l(long double __k, long double __phi) { return __detail::__ellint_2<long double>(__k, __phi); } + /// 5.2.1.13 Incomplete elliptic integrals of the second kind. template<typename _Tp, typename _Tpp> inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type ellint_2(_Tp __k, _Tpp __phi) @@ -305,7 +305,6 @@ namespace tr1 return __detail::__ellint_2<__type>(__k, __phi); } - // 5.2.1.14 Incomplete elliptic integrals of the third kind. inline float ellint_3f(float __k, float __nu, float __phi) { return __detail::__ellint_3<float>(__k, __nu, __phi); } @@ -314,6 +313,7 @@ namespace tr1 ellint_3l(long double __k, long double __nu, long double __phi) { return __detail::__ellint_3<long double>(__k, __nu, __phi); } + /// 5.2.1.14 Incomplete elliptic integrals of the third kind. template<typename _Tp, typename _Tpn, typename _Tpp> inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi) @@ -322,7 +322,6 @@ namespace tr1 return __detail::__ellint_3<__type>(__k, __nu, __phi); } - // 5.2.1.15 Exponential integrals. inline float expintf(float __x) { return __detail::__expint<float>(__x); } @@ -331,6 +330,7 @@ namespace tr1 expintl(long double __x) { return __detail::__expint<long double>(__x); } + /// 5.2.1.15 Exponential integrals. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type expint(_Tp __x) @@ -339,7 +339,6 @@ namespace tr1 return __detail::__expint<__type>(__x); } - // 5.2.1.16 Hermite polynomials. inline float hermitef(unsigned int __n, float __x) { return __detail::__poly_hermite<float>(__n, __x); } @@ -348,6 +347,7 @@ namespace tr1 hermitel(unsigned int __n, long double __x) { return __detail::__poly_hermite<long double>(__n, __x); } + /// 5.2.1.16 Hermite polynomials. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type hermite(unsigned int __n, _Tp __x) @@ -356,7 +356,6 @@ namespace tr1 return __detail::__poly_hermite<__type>(__n, __x); } - // 5.2.1.17 Hypergeometric functions. inline float hypergf(float __a, float __b, float __c, float __x) { return __detail::__hyperg<float>(__a, __b, __c, __x); } @@ -365,6 +364,7 @@ namespace tr1 hypergl(long double __a, long double __b, long double __c, long double __x) { return __detail::__hyperg<long double>(__a, __b, __c, __x); } + /// 5.2.1.17 Hypergeometric functions. template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp> inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x) @@ -373,7 +373,6 @@ namespace tr1 return __detail::__hyperg<__type>(__a, __b, __c, __x); } - // 5.2.1.18 Laguerre polynomials. inline float laguerref(unsigned int __n, float __x) { return __detail::__laguerre<float>(__n, __x); } @@ -382,6 +381,7 @@ namespace tr1 laguerrel(unsigned int __n, long double __x) { return __detail::__laguerre<long double>(__n, __x); } + /// 5.2.1.18 Laguerre polynomials. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type laguerre(unsigned int __n, _Tp __x) @@ -390,7 +390,6 @@ namespace tr1 return __detail::__laguerre<__type>(__n, __x); } - // 5.2.1.19 Legendre polynomials. inline float legendref(unsigned int __n, float __x) { return __detail::__poly_legendre_p<float>(__n, __x); } @@ -399,6 +398,7 @@ namespace tr1 legendrel(unsigned int __n, long double __x) { return __detail::__poly_legendre_p<long double>(__n, __x); } + /// 5.2.1.19 Legendre polynomials. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type legendre(unsigned int __n, _Tp __x) @@ -407,7 +407,6 @@ namespace tr1 return __detail::__poly_legendre_p<__type>(__n, __x); } - // 5.2.1.20 Riemann zeta function. inline float riemann_zetaf(float __x) { return __detail::__riemann_zeta<float>(__x); } @@ -416,6 +415,7 @@ namespace tr1 riemann_zetal(long double __x) { return __detail::__riemann_zeta<long double>(__x); } + /// 5.2.1.20 Riemann zeta function. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type riemann_zeta(_Tp __x) @@ -424,7 +424,6 @@ namespace tr1 return __detail::__riemann_zeta<__type>(__x); } - // 5.2.1.21 Spherical Bessel functions. inline float sph_besself(unsigned int __n, float __x) { return __detail::__sph_bessel<float>(__n, __x); } @@ -433,6 +432,7 @@ namespace tr1 sph_bessell(unsigned int __n, long double __x) { return __detail::__sph_bessel<long double>(__n, __x); } + /// 5.2.1.21 Spherical Bessel functions. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type sph_bessel(unsigned int __n, _Tp __x) @@ -441,7 +441,6 @@ namespace tr1 return __detail::__sph_bessel<__type>(__n, __x); } - // 5.2.1.22 Spherical associated Legendre functions. inline float sph_legendref(unsigned int __l, unsigned int __m, float __theta) { return __detail::__sph_legendre<float>(__l, __m, __theta); } @@ -450,6 +449,7 @@ namespace tr1 sph_legendrel(unsigned int __l, unsigned int __m, long double __theta) { return __detail::__sph_legendre<long double>(__l, __m, __theta); } + /// 5.2.1.22 Spherical associated Legendre functions. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta) @@ -458,7 +458,6 @@ namespace tr1 return __detail::__sph_legendre<__type>(__l, __m, __theta); } - // 5.2.1.23 Spherical Neumann functions. inline float sph_neumannf(unsigned int __n, float __x) { return __detail::__sph_neumann<float>(__n, __x); } @@ -467,6 +466,7 @@ namespace tr1 sph_neumannl(unsigned int __n, long double __x) { return __detail::__sph_neumann<long double>(__n, __x); } + /// 5.2.1.23 Spherical Neumann functions. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type sph_neumann(unsigned int __n, _Tp __x) @@ -475,7 +475,7 @@ namespace tr1 return __detail::__sph_neumann<__type>(__n, __x); } - /* @} */ // group tr1_math_spec_func + /* @} */ // tr1_math_spec_func } } diff --git a/libstdc++-v3/include/tr1/ell_integral.tcc b/libstdc++-v3/include/tr1/ell_integral.tcc index 7eaab6f5fe3..404cc278cf2 100644 --- a/libstdc++-v3/include/tr1/ell_integral.tcc +++ b/libstdc++-v3/include/tr1/ell_integral.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -55,14 +55,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -753,9 +746,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/exp_integral.tcc b/libstdc++-v3/include/tr1/exp_integral.tcc index 58c62f21de6..5dff27c0823 100644 --- a/libstdc++-v3/include/tr1/exp_integral.tcc +++ b/libstdc++-v3/include/tr1/exp_integral.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -60,14 +60,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -530,9 +523,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/gamma.tcc b/libstdc++-v3/include/tr1/gamma.tcc index 06a88d94f0e..892dacdecce 100644 --- a/libstdc++-v3/include/tr1/gamma.tcc +++ b/libstdc++-v3/include/tr1/gamma.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -58,15 +58,7 @@ namespace std { namespace tr1 { - - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -477,9 +469,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/hypergeometric.tcc b/libstdc++-v3/include/tr1/hypergeometric.tcc index 29c388f9a43..5e6902f98ed 100644 --- a/libstdc++-v3/include/tr1/hypergeometric.tcc +++ b/libstdc++-v3/include/tr1/hypergeometric.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -54,14 +54,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -780,9 +773,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/legendre_function.tcc b/libstdc++-v3/include/tr1/legendre_function.tcc index da49a3aaa08..8c3f8770b36 100644 --- a/libstdc++-v3/include/tr1/legendre_function.tcc +++ b/libstdc++-v3/include/tr1/legendre_function.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -59,14 +59,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -161,7 +154,8 @@ namespace tr1 _Tp __p_mm = _Tp(1); if (__m > 0) { - // Two square roots seem more accurate more of the time than just one. + // Two square roots seem more accurate more of the time + // than just one. _Tp __root = std::sqrt(_Tp(1) - __x) * std::sqrt(_Tp(1) + __x); _Tp __fact = _Tp(1); for (unsigned int __i = 1; __i <= __m; ++__i) @@ -310,9 +304,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/modified_bessel_func.tcc b/libstdc++-v3/include/tr1/modified_bessel_func.tcc index 912f99faea4..98aab8d4f97 100644 --- a/libstdc++-v3/include/tr1/modified_bessel_func.tcc +++ b/libstdc++-v3/include/tr1/modified_bessel_func.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -61,14 +61,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -442,9 +435,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/poly_hermite.tcc b/libstdc++-v3/include/tr1/poly_hermite.tcc index 2d8ccfea8d5..9851e8056ed 100644 --- a/libstdc++-v3/include/tr1/poly_hermite.tcc +++ b/libstdc++-v3/include/tr1/poly_hermite.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -52,14 +52,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -130,9 +123,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/poly_laguerre.tcc b/libstdc++-v3/include/tr1/poly_laguerre.tcc index 4164d90d231..24cdd181321 100644 --- a/libstdc++-v3/include/tr1/poly_laguerre.tcc +++ b/libstdc++-v3/include/tr1/poly_laguerre.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -54,14 +54,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -335,9 +328,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/riemann_zeta.tcc b/libstdc++-v3/include/tr1/riemann_zeta.tcc index 40277c03412..62512f85be1 100644 --- a/libstdc++-v3/include/tr1/riemann_zeta.tcc +++ b/libstdc++-v3/include/tr1/riemann_zeta.tcc @@ -1,6 +1,6 @@ // Special functions -*- C++ -*- -// Copyright (C) 2006-2007 +// Copyright (C) 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -57,14 +57,7 @@ namespace tr1 // [5.2] Special functions - /** - * @ingroup tr1_math_spec_func - * @{ - */ - - // // Implementation-space details. - // namespace __detail { @@ -441,9 +434,6 @@ namespace tr1 } } // namespace std::tr1::__detail - - /* @} */ // group tr1_math_spec_func - } } diff --git a/libstdc++-v3/include/tr1/special_function_util.h b/libstdc++-v3/include/tr1/special_function_util.h index 2f33c39f886..a07a193679b 100644 --- a/libstdc++-v3/include/tr1/special_function_util.h +++ b/libstdc++-v3/include/tr1/special_function_util.h @@ -42,7 +42,6 @@ #ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H #define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1 -// namespace std::tr1 namespace std { namespace tr1 @@ -51,21 +50,17 @@ namespace tr1 namespace __detail { - /// - /// @brief A class to encapsulate type dependent floating point - /// constants. Not everything will be able to be expressed - /// as type logic. - /// - template <typename _Tp> + /// A class to encapsulate type dependent floating point + /// constants. Not everything will be able to be expressed as + /// type logic. + template<typename _Tp> struct __floating_point_constant { static const _Tp __value; }; - /// - /// @brief A structure for numeric constants. - /// + /// A structure for numeric constants. template<typename _Tp> struct __numeric_constants { @@ -111,15 +106,13 @@ namespace tr1 }; - /// - /// @brief This is a wrapper for the isnan function. - /// Otherwise, for NaN, all comparisons result in false. - /// If/when we build a std::isnan out of intrinsics, this - /// will disappear completely in favor of std::isnan. - /// #if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC - template <typename _Tp> + /// This is a wrapper for the isnan function. Otherwise, for NaN, + /// all comparisons result in false. If/when we build a std::isnan + /// out of intrinsics, this will disappear completely in favor of + /// std::isnan. + template<typename _Tp> inline bool __isnan(const _Tp __x) { return std::isnan(__x); @@ -127,19 +120,19 @@ namespace tr1 #else - template <typename _Tp> + template<typename _Tp> inline bool __isnan(const _Tp __x) { return __builtin_isnan(__x); } - template <> + template<> inline bool __isnan<float>(const float __x) { return __builtin_isnanf(__x); } - template <> + template<> inline bool __isnan<long double>(const long double __x) { return __builtin_isnanl(__x); diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple index e4185e26555..09ee501e691 100644 --- a/libstdc++-v3/include/tr1/tuple +++ b/libstdc++-v3/include/tr1/tuple @@ -246,7 +246,7 @@ namespace tr1 template<typename _Tp> struct tuple_size; - /// @brief class tuple_size + /// class tuple_size template<typename... _Elements> struct tuple_size<tuple<_Elements...> > { diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index 4533ee5dc6c..734eec6ab7e 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -183,7 +183,7 @@ namespace tr1 template<typename _From, typename _To, bool = (is_void<_From>::value || is_void<_To>::value || is_function<_To>::value || is_array<_To>::value - // This special case is here only to avoid warnings. + // This special case is here only to avoid warnings. || (is_floating_point<typename remove_reference<_From>::type>::value && __is_int_or_cref<_To>::__value))> @@ -206,7 +206,7 @@ namespace tr1 __is_convertible_helper<_From, _To>::__value> { }; - /// @brief reference modifications [4.7.2]. + // reference modifications [4.7.2]. template<typename _Tp> struct remove_reference { typedef _Tp type; }; @@ -230,7 +230,7 @@ namespace tr1 : public __add_reference_helper<_Tp> { }; - /// @brief other transformations [4.8]. + // other transformations [4.8]. template<std::size_t _Len, std::size_t _Align> struct aligned_storage { diff --git a/libstdc++-v3/include/tr1_impl/array b/libstdc++-v3/include/tr1_impl/array index 7a13ba8ff8d..437670f3dfc 100644 --- a/libstdc++-v3/include/tr1_impl/array +++ b/libstdc++-v3/include/tr1_impl/array @@ -36,7 +36,7 @@ namespace std { _GLIBCXX_BEGIN_NAMESPACE_TR1 - /// @brief struct array. + /// array. /// NB: Requires complete type _Tp. template<typename _Tp, std::size_t _Nm> struct array @@ -216,8 +216,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { std::swap_ranges(__one.begin(), __one.end(), __two.begin()); } // Tuple interface to class template array [6.2.2.5]. - template<typename _Tp> class tuple_size; - template<int _Int, typename _Tp> class tuple_element; + + /// tuple_size + template<typename _Tp> + class tuple_size; + + /// tuple_element + template<int _Int, typename _Tp> + class tuple_element; template<typename _Tp, std::size_t _Nm> struct tuple_size<array<_Tp, _Nm> > diff --git a/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h index 53f8c0febf5..a3fd80e8551 100644 --- a/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h @@ -195,7 +195,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #endif /** - * @class shared_ptr <tr1/memory> + * @class __shared_ptr * * A smart pointer with reference-counted copy semantics. * The object pointed to is deleted when the last shared_ptr pointing to @@ -230,7 +230,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } // - // Requirements: _Deleter's copy constructor and destructor must not throw + // Requirements: _Deleter's copy constructor and destructor must + // not throw // // __shared_ptr will release __p by calling __d(__p) // @@ -252,8 +253,9 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #ifdef _GLIBCXX_INCLUDE_AS_CXX0X // - // Requirements: _Deleter's copy constructor and destructor must not throw - // _Alloc's copy constructor and destructor must not throw. + // Requirements: _Deleter's copy constructor and destructor must + // not throw _Alloc's copy constructor and destructor must not + // throw. // // __shared_ptr will release __p by calling __d(__p) // @@ -811,7 +813,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 }; - // The actual TR1 shared_ptr, with forwarding constructors and + /// shared_ptr + // The actual shared_ptr, with forwarding constructors and // assignment operators. template<typename _Tp> class shared_ptr @@ -965,7 +968,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } - // The actual TR1 weak_ptr, with forwarding constructors and + /// weak_ptr + // The actual weak_ptr, with forwarding constructors and // assignment operators. template<typename _Tp> class weak_ptr @@ -1021,7 +1025,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } }; - + /// enable_shared_from_this template<typename _Tp> class enable_shared_from_this { diff --git a/libstdc++-v3/include/tr1_impl/cmath b/libstdc++-v3/include/tr1_impl/cmath index 3bbbda21504..afb05e2aa71 100644 --- a/libstdc++-v3/include/tr1_impl/cmath +++ b/libstdc++-v3/include/tr1_impl/cmath @@ -298,8 +298,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #if _GLIBCXX_USE_C99_MATH #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC - /// @brief Function template definitions [8.16.3]. - // + /// Function template definitions [8.16.3]. using std::signbit; using std::fpclassify; @@ -320,8 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #if _GLIBCXX_USE_C99_MATH_TR1 - /// @brief Additional overloads [8.16.4]. - // + /// Additional overloads [8.16.4]. using std::acos; inline float diff --git a/libstdc++-v3/include/tr1_impl/complex b/libstdc++-v3/include/tr1_impl/complex index 5c25cae4fb4..e7d433edc68 100644 --- a/libstdc++-v3/include/tr1_impl/complex +++ b/libstdc++-v3/include/tr1_impl/complex @@ -51,7 +51,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&); #endif - /// @brief acos(__z) [8.1.2]. + /// acos(__z) [8.1.2]. // Effects: Behaves the same as C99 function cacos, defined // in subclause 7.3.5.1. template<typename _Tp> @@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_acos(__z); } #endif - /// @brief asin(__z) [8.1.3]. + /// asin(__z) [8.1.3]. // Effects: Behaves the same as C99 function casin, defined // in subclause 7.3.5.2. template<typename _Tp> @@ -123,7 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_asin(__z); } #endif - /// @brief atan(__z) [8.1.4]. + /// atan(__z) [8.1.4]. // Effects: Behaves the same as C99 function catan, defined // in subclause 7.3.5.3. template<typename _Tp> @@ -167,7 +167,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_atan(__z); } #endif - /// @brief acosh(__z) [8.1.5]. + /// acosh(__z) [8.1.5]. // Effects: Behaves the same as C99 function cacosh, defined // in subclause 7.3.6.1. template<typename _Tp> @@ -206,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_acosh(__z); } #endif - /// @brief asinh(__z) [8.1.6]. + /// asinh(__z) [8.1.6]. // Effects: Behaves the same as C99 function casin, defined // in subclause 7.3.6.2. template<typename _Tp> @@ -245,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_asinh(__z); } #endif - /// @brief atanh(__z) [8.1.7]. + /// atanh(__z) [8.1.7]. // Effects: Behaves the same as C99 function catanh, defined // in subclause 7.3.6.3. template<typename _Tp> @@ -289,7 +289,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return __complex_atanh(__z); } #endif - /// @brief fabs(__z) [8.1.8]. + /// fabs(__z) [8.1.8]. // Effects: Behaves the same as C99 function cabs, defined // in subclause 7.3.8.1. template<typename _Tp> @@ -306,8 +306,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 || (defined(_GLIBCXX_INCLUDE_AS_TR1) \ && !defined(__GXX_EXPERIMENTAL_CXX0X__))) - /// @brief Additional overloads [8.1.9]. - // + /// Additional overloads [8.1.9]. template<typename _Tp> inline typename __gnu_cxx::__promote<_Tp>::__type arg(_Tp __x) diff --git a/libstdc++-v3/include/tr1_impl/functional b/libstdc++-v3/include/tr1_impl/functional index 2a522edf814..b819374f92d 100644 --- a/libstdc++-v3/include/tr1_impl/functional +++ b/libstdc++-v3/include/tr1_impl/functional @@ -426,6 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 : binary_function<const volatile _T1*, _T2, _Res> { }; + /// reference_wrapper template<typename _Tp> class reference_wrapper : public _Reference_wrapper_base<typename remove_cv<_Tp>::type> @@ -1336,6 +1337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Result, typename _Signature> const bool is_bind_expression<_Bind_result<_Result, _Signature> >::value; + /// bind template<typename _Functor, typename... _ArgTypes> inline _Bind<typename _Maybe_wrap_member_pointer<_Functor>::type(_ArgTypes...)> @@ -1751,6 +1753,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } }; + /// class function template<typename _Res, typename... _ArgTypes> class function<_Res(_ArgTypes...)> : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>, diff --git a/libstdc++-v3/include/tr1_impl/functional_hash.h b/libstdc++-v3/include/tr1_impl/functional_hash.h index 0dfff38e7b9..0611f70d34a 100644 --- a/libstdc++-v3/include/tr1_impl/functional_hash.h +++ b/libstdc++-v3/include/tr1_impl/functional_hash.h @@ -1,6 +1,6 @@ // TR1 functional -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -36,7 +36,7 @@ namespace std { _GLIBCXX_BEGIN_NAMESPACE_TR1 - // Class template hash. + /// Class template hash. // Declaration of default hash functor std::tr1::hash. The types for // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR. template<typename _Tp> @@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 operator()(_Tp __val) const; }; - // Partial specializations for pointer types. + /// Partial specializations for pointer types. template<typename _Tp> struct hash<_Tp*> : public std::unary_function<_Tp*, size_t> { @@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { return reinterpret_cast<size_t>(__p); } }; - // Explicit specializations for integer types. + /// Explicit specializations for integer types. #define _TR1_hashtable_define_trivial_hash(_Tp) \ template<> \ inline size_t \ @@ -81,7 +81,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 // Fowler / Noll / Vo (FNV) Hash (type FNV-1a) // (Used by the next specializations of std::tr1::hash.) - // Dummy generic implementation (for sizeof(size_t) != 4, 8). + /// Dummy generic implementation (for sizeof(size_t) != 4, 8). template<size_t = sizeof(size_t)> struct _Fnv_hash { @@ -128,7 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } }; - // Explicit specializations for floating point types. + /// Explicit specializations for float. template<> inline size_t hash<float>::operator()(float __val) const @@ -142,6 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 return __result; }; + /// Explicit specializations for double. template<> inline size_t hash<double>::operator()(double __val) const @@ -155,11 +156,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 return __result; }; + /// Explicit specializations for long double. template<> size_t hash<long double>::operator()(long double __val) const; - // Explicit specialization of member operator for types that are not builtin. + /// Explicit specialization of member operator for non-builtin types. template<> size_t hash<string>::operator()(string) const; diff --git a/libstdc++-v3/include/tr1_impl/random b/libstdc++-v3/include/tr1_impl/random index c10ee577cae..b45368d7532 100644 --- a/libstdc++-v3/include/tr1_impl/random +++ b/libstdc++-v3/include/tr1_impl/random @@ -149,8 +149,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 } // namespace __detail /** - * Produces random numbers on a given distribution function using a non-uniform - * random number generation engine. + * Produces random numbers on a given distribution function using a + * non-uniform random number generation engine. * * @todo the engine_value_type needs to be studied more carefully. */ diff --git a/libstdc++-v3/include/tr1_impl/regex b/libstdc++-v3/include/tr1_impl/regex index bf4c309c762..f99e0067850 100644 --- a/libstdc++-v3/include/tr1_impl/regex +++ b/libstdc++-v3/include/tr1_impl/regex @@ -241,7 +241,7 @@ namespace regex_constants static const match_flag_type format_first_only = 1 << _S_first_only; - // [7.5.3] implementation-defined error type + /// [7.5.3] implementation-defined error type enum error_type { _S_error_collate, @@ -308,7 +308,7 @@ namespace regex_constants // [7.8] Class regex_error /** - * Defines the type of objects thrown as exceptions to report errors from the + * Defines the exception objects thrown report errors from the * regular expression library. */ class regex_error diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits index 9298aae31a0..4cf97dff31f 100644 --- a/libstdc++-v3/include/tr1_impl/type_traits +++ b/libstdc++-v3/include/tr1_impl/type_traits @@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type volatile>, _Value) \ _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const volatile>, _Value) - /// @brief helper classes [4.3]. + /// helper classes [4.3]. template<typename _Tp, _Tp __v> struct integral_constant { @@ -75,18 +75,23 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 typedef _Tp value_type; typedef integral_constant<_Tp, __v> type; }; + + /// typedef for true_type typedef integral_constant<bool, true> true_type; + + /// typedef for true_type typedef integral_constant<bool, false> false_type; template<typename _Tp, _Tp __v> const _Tp integral_constant<_Tp, __v>::value; - /// @brief primary type categories [4.5.1]. + /// primary type categories [4.5.1]. template<typename> struct is_void : public false_type { }; _DEFINE_SPEC(0, is_void, void, true) + /// is_integral template<typename> struct is_integral : public false_type { }; @@ -106,6 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 _DEFINE_SPEC(0, is_integral, long long, true) _DEFINE_SPEC(0, is_integral, unsigned long long, true) + /// is_floating_point template<typename> struct is_floating_point : public false_type { }; @@ -113,6 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 _DEFINE_SPEC(0, is_floating_point, double, true) _DEFINE_SPEC(0, is_floating_point, long double, true) + /// is_array template<typename> struct is_array : public false_type { }; @@ -125,39 +132,47 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct is_array<_Tp[]> : public true_type { }; + /// is_pointer template<typename> struct is_pointer : public false_type { }; _DEFINE_SPEC(1, is_pointer, _Tp*, true) + /// is_reference template<typename _Tp> struct is_reference; + /// is_function template<typename _Tp> struct is_function; + /// is_member_object_pointer template<typename> struct is_member_object_pointer : public false_type { }; _DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*, !is_function<_Tp>::value) + /// is_member_function_pointer template<typename> struct is_member_function_pointer : public false_type { }; _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*, is_function<_Tp>::value) + /// is_enum template<typename _Tp> struct is_enum : public integral_constant<bool, __is_enum(_Tp)> { }; + /// is_union template<typename _Tp> struct is_union : public integral_constant<bool, __is_union(_Tp)> { }; + /// is_class template<typename _Tp> struct is_class : public integral_constant<bool, __is_class(_Tp)> @@ -177,9 +192,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 static const bool __value = sizeof(__test<_Tp>(0)) == 1; }; + /// is_abstract template<typename _Tp> struct is_abstract; + /// is_function template<typename _Tp> struct is_function : public integral_constant<bool, !(__in_array<_Tp>::__value @@ -188,19 +205,21 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 || is_void<_Tp>::value)> { }; - /// @brief composite type traits [4.5.2]. + /// composite type traits [4.5.2]. template<typename _Tp> struct is_arithmetic : public integral_constant<bool, (is_integral<_Tp>::value || is_floating_point<_Tp>::value)> { }; + /// is_fundamental template<typename _Tp> struct is_fundamental : public integral_constant<bool, (is_arithmetic<_Tp>::value || is_void<_Tp>::value)> { }; + /// is_object template<typename _Tp> struct is_object : public integral_constant<bool, !(is_function<_Tp>::value @@ -208,9 +227,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 || is_void<_Tp>::value)> { }; + /// is_member_pointer template<typename _Tp> struct is_member_pointer; + /// is_scalal template<typename _Tp> struct is_scalar : public integral_constant<bool, (is_arithmetic<_Tp>::value @@ -219,10 +240,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 || is_member_pointer<_Tp>::value)> { }; + /// is_compound template<typename _Tp> struct is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> { }; + /// is_member_pointer template<typename _Tp> struct is_member_pointer : public integral_constant<bool, @@ -230,15 +253,17 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 || is_member_function_pointer<_Tp>::value)> { }; - /// @brief type properties [4.5.3]. + /// type properties [4.5.3]. template<typename> struct is_const : public false_type { }; + /// is_const template<typename _Tp> struct is_const<_Tp const> : public true_type { }; + /// is_volatile template<typename> struct is_volatile : public false_type { }; @@ -247,30 +272,36 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct is_volatile<_Tp volatile> : public true_type { }; + /// is_empty template<typename _Tp> struct is_empty : public integral_constant<bool, __is_empty(_Tp)> { }; + /// is_polymorphic template<typename _Tp> struct is_polymorphic : public integral_constant<bool, __is_polymorphic(_Tp)> { }; + /// is_abstract template<typename _Tp> struct is_abstract : public integral_constant<bool, __is_abstract(_Tp)> { }; + /// has_virtual_destructor template<typename _Tp> struct has_virtual_destructor : public integral_constant<bool, __has_virtual_destructor(_Tp)> { }; + /// alignment_of template<typename _Tp> struct alignment_of : public integral_constant<std::size_t, __alignof__(_Tp)> { }; + /// rank template<typename> struct rank : public integral_constant<std::size_t, 0> { }; @@ -283,6 +314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct rank<_Tp[]> : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; + /// extent template<typename, unsigned _Uint = 0> struct extent : public integral_constant<std::size_t, 0> { }; @@ -301,7 +333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 _Uint - 1>::value> { }; - /// @brief relationships between types [4.6]. + /// relationships between types [4.6]. template<typename, typename> struct is_same : public false_type { }; @@ -310,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct is_same<_Tp, _Tp> : public true_type { }; - /// @brief const-volatile modifications [4.7.1]. + /// const-volatile modifications [4.7.1]. template<typename _Tp> struct remove_const { typedef _Tp type; }; @@ -319,6 +351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct remove_const<_Tp const> { typedef _Tp type; }; + /// remove_volatile template<typename _Tp> struct remove_volatile { typedef _Tp type; }; @@ -327,6 +360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct remove_volatile<_Tp volatile> { typedef _Tp type; }; + /// remove_cv template<typename _Tp> struct remove_cv { @@ -334,14 +368,17 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 remove_const<typename remove_volatile<_Tp>::type>::type type; }; + /// add_const template<typename _Tp> struct add_const { typedef _Tp const type; }; + /// add_volatile template<typename _Tp> struct add_volatile { typedef _Tp volatile type; }; + /// add_cv template<typename _Tp> struct add_cv { @@ -349,7 +386,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 add_const<typename add_volatile<_Tp>::type>::type type; }; - /// @brief array modifications [4.7.3]. + /// array modifications [4.7.3]. template<typename _Tp> struct remove_extent { typedef _Tp type; }; @@ -362,6 +399,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct remove_extent<_Tp[]> { typedef _Tp type; }; + /// remove_all_extents template<typename _Tp> struct remove_all_extents { typedef _Tp type; }; @@ -374,19 +412,22 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct remove_all_extents<_Tp[]> { typedef typename remove_all_extents<_Tp>::type type; }; - /// @brief pointer modifications [4.7.4]. + /// pointer modifications [4.7.4]. #undef _DEFINE_SPEC_BODY #define _DEFINE_SPEC_BODY(_Value) \ { typedef _Tp type; }; + /// remove_pointer template<typename _Tp> struct remove_pointer { typedef _Tp type; }; _DEFINE_SPEC(1, remove_pointer, _Tp*, false) + /// remove_reference template<typename _Tp> struct remove_reference; + /// add_pointer template<typename _Tp> struct add_pointer { typedef typename remove_reference<_Tp>::type* type; }; diff --git a/libstdc++-v3/include/tr1_impl/unordered_map b/libstdc++-v3/include/tr1_impl/unordered_map index 5ecd5c0a998..bb69479f277 100644 --- a/libstdc++-v3/include/tr1_impl/unordered_map +++ b/libstdc++-v3/include/tr1_impl/unordered_map @@ -168,6 +168,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { __x.swap(__y); } + /// class unordered_map template<class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, @@ -215,6 +216,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #endif }; + /// class unordered_multimap template<class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, diff --git a/libstdc++-v3/include/tr1_impl/unordered_set b/libstdc++-v3/include/tr1_impl/unordered_set index bdc1575a445..80b1ec5f003 100644 --- a/libstdc++-v3/include/tr1_impl/unordered_set +++ b/libstdc++-v3/include/tr1_impl/unordered_set @@ -150,10 +150,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<class _Value, class _Hash, class _Pred, class _Alloc, bool __cache_hash_code> inline void - swap (__unordered_set<_Value, _Hash, _Pred, - _Alloc, __cache_hash_code>& __x, - __unordered_set<_Value, _Hash, _Pred, - _Alloc, __cache_hash_code>& __y) + swap(__unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __x, + __unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __y) { __x.swap(__y); } template<class _Value, class _Hash, class _Pred, class _Alloc, @@ -166,6 +164,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { __x.swap(__y); } + /// class unordered_set template<class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, @@ -213,6 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 #endif }; + /// class unordered_multiset template<class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, diff --git a/libstdc++-v3/scripts/run_doxygen b/libstdc++-v3/scripts/run_doxygen index 48e40ba8615..dcaea51158e 100644 --- a/libstdc++-v3/scripts/run_doxygen +++ b/libstdc++-v3/scripts/run_doxygen @@ -10,7 +10,7 @@ # We can check now that the version of doxygen is >= this variable. -DOXYVER=1.5.4 +DOXYVER=1.5.1 find_doxygen() { local -r v_required=`echo $DOXYVER | \ @@ -156,7 +156,6 @@ fi -e "s=@srcdir@=${srcdir}=g" \ -e "s=@builddir@=${builddir}=g" \ -e "s=@host_alias@=${host_alias}=g" \ - -e "s=@html_output_dir@=html=" \ -e "s=@enabled_sections@=${enabled_sections}=" \ -e "s=@do_html@=${do_html}=" \ -e "s=@do_man@=${do_man}=" \ diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc index 2609c430998..5a8ec640fef 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc @@ -50,7 +50,7 @@ int main() return 0; } -// { dg-error "is private" "" { target *-*-* } 75 } +// { dg-error "is private" "" { target *-*-* } 76 } // { dg-error "within this context" "" { target *-*-* } 29 } // { dg-error "first required here" "" { target *-*-* } 48 } // { dg-excess-errors "copy constructor" } diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index ff912c2cc0a..dc33931a665 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -49,8 +49,8 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 41 } // { dg-error "instantiated from here" "" { target *-*-* } 43 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 511 } -// { dg-error "declaration of" "" { target *-*-* } 477 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 549 } +// { dg-error "declaration of" "" { target *-*-* } 515 } // { dg-excess-errors "At global scope" } // { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index 5b2b3dc9f82..0b02e3345f6 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -49,8 +49,8 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 41 } // { dg-error "instantiated from here" "" { target *-*-* } 43 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 436 } -// { dg-error "declaration of" "" { target *-*-* } 402 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 474 } +// { dg-error "declaration of" "" { target *-*-* } 440 } // { dg-excess-errors "At global scope" } // { dg-excess-errors "In instantiation of" } |